Ticket #1189 (closed enhancement: invalid)

Opened 2 years ago

Last modified 7 weeks ago

[cla] TaskBarItem improvement

Reported by: andrei.neculau@… Owned by: dante
Priority: normal Milestone:
Component: Dojox Version: 0.3
Severity: normal Keywords:
Cc:

Description (last modified by dante) (diff)

If you click on the taskbar "button", the window runs the toggle effect even if the window is already showing.

Fix:

Index: D:/xhosts/dentab.ro.my/www/js/dojo_nightly/src/widget/TaskBar.js
===================================================================
--- D:/xhosts/dentab.ro.my/www/js/dojo_nightly/src/widget/TaskBar.js	(revision 5011)
+++ D:/xhosts/dentab.ro.my/www/js/dojo_nightly/src/widget/TaskBar.js	(working copy)
@@ -36,7 +36,10 @@
 	},
 
 	onClick: function() {
-		this.window.show();
+		if (!this.window.isShowing())
+		{
+			this.window.show();
+		}
 	}
 });

Change History

Changed 2 years ago by andrei.neculau@…

  • priority changed from normal to high

I would like to "correct"/enhance my fix.

this.window.show only shows the window, doesn't set the windowState. Plus, the taskbar should react when the window isShowing by minimizing it.

Correct Fix:

Index: D:/xhosts/dentab.ro.my/www/js/dojo_nightly/src/widget/TaskBar.js
===================================================================
--- D:/xhosts/dentab.ro.my/www/js/dojo_nightly/src/widget/TaskBar.js	(revision 5011)
+++ D:/xhosts/dentab.ro.my/www/js/dojo_nightly/src/widget/TaskBar.js	(working copy)
@@ -36,7 +36,13 @@
 	},
 
 	onClick: function() {
-		this.window.show();
+		if (!this.window.isShowing())
+		{
+			this.window.restoreWindow();
+		}
+		else {
+			this.window.minimizeWindow();
+		}
 	}
 });

Changed 2 years ago by bill

  • priority changed from high to normal
  • milestone changed from 0.4 to 0.5

Again, we need the CLA. Also note that your change will be a bit strange if you click the taskbar item for a maximized window. (In Microsoft Windows, clicking the taskbar twice on a maximized window will minimize then maximize, but your code will minimize the window but then display it in normal mode.)

Changed 2 years ago by chris.newbill@…

Bill, Andrei,

Why not implement the fix like this? It's simple and it will retain state, including maximized. It will not handle the double click issue obviously, as that is a different event.

	onClick: function() {
		if (this.window.isHidden)
			this.window.show();
		else
			this.window.hide();
	}

v/r, -Chris Newbill

Changed 2 years ago by chris.newbill@…

This is a better implementation, but it requires a change to FloatingPane?.js also (addition of hasFocus attribute).

It emulates the behavior of the windows start bar with the exception that in FloatingPane?.js, if an item loses focus we'll attempt to focus the next highest z-order if available. I'll post these changes in #1184.

It's a judgment call really, because unless the widget implements the methods restoreWindow, bringToTop, and minimizeWindow, you'll be limited to adding FloatingPanes? (and derived classes) to the TaskBar?. Which seems okay to me, but I'm not sure if that's the design goals.

TaskBarItem?.onClick

	onClick: function() {
		// first check if it's hidden
		if (this.window.isHidden)
			this.window.restoreWindow();
		else
			// now check if it's in focus
			if (!this.window.hasFocus)
				this.window.bringToTop();
			else
				this.window.minimizeWindow();
	}

Changed 13 months ago by bill

  • component changed from Widgets to Dojox
  • milestone deleted

Changed 4 months ago by dylan

  • owner changed from bill to dante
  • summary changed from TaskBarItem improvement to [cla] TaskBarItem improvement
  • milestone set to 1.2

Decide if this is relevant in the 1.0-realm. CLA on file for Chris Newbill.

Changed 7 weeks ago by dante

  • status changed from new to closed
  • resolution set to invalid
  • description modified (diff)
  • milestone deleted

marking as 'invalid' only because the current state of web-desktop UI is poor in dojox FloatingPane?, and when(if) re factored, this will be duly noted. The "taskbar" of 1.0 is a poorly implemented experimental component called "Dock" I hope to deprecate. I do suggest psychef and whomever working out a solid api for this kind of thing (dojox forums, I proposed dojox.desktop ... )

Note: See TracTickets for help on using tickets.