Permalink
Browse files

Move to the indigo theme. Add a focus indicator for a table.

  • Loading branch information...
1 parent 7d7ab75 commit bdbb10e5c1a9290aaca754a3a1fe7eb694338e44 @arcusfelis committed Mar 20, 2013
View
@@ -43,7 +43,8 @@
"${APPLICATION}.test.*", "${APPLICATION}.simulation.*"],
"LOCALES" : [ "en" ],
"CACHE" : "cache",
- "ROOT" : "."
+ "ROOT" : ".",
+ "BUILD_PATH" : "priv/html"
},
// You only need to edit the remainder of this file, if you want to customize
@@ -41,6 +41,9 @@ qx.Class.define("cascadae.Application",
this.base(arguments);
this.getRoot().setNativeContextMenu(true);
+ // Forward focused state of a tabel to its status bar
+ qx.ui.table.Table.prototype._forwardStates = {focused: true};
+
// Enable logging in debug variant
// if (qx.core.Environment.get("qx.debug"))
// {
@@ -64,6 +67,8 @@ qx.Class.define("cascadae.Application",
// Initialize the compositor
this.__container = new cascadae.Container(this, socket);
+ var fh = qx.ui.core.FocusHandler.getInstance();
+ fh.addRoot(this.__container);
this.getRoot().add(this.__container, { edge : 0 });
},
@@ -52,7 +52,6 @@ qx.Class.define("cascadae.Container",
this.__mainStack.add(this.__table);
socket.registerObject(this.__table);
-
this.__infosplit = new qx.ui.splitpane.Pane("horizontal");
this.__infosplit.setDecorator(null);
this.add(this.__infosplit);
@@ -447,6 +446,7 @@ qx.Class.define("cascadae.Container",
this.__logTable.setActive(true);
},
+ __focusedWidget: null,
/**
* TODOC
@@ -455,8 +455,26 @@ qx.Class.define("cascadae.Container",
*/
setEnabled : function(isEnabled)
{
+ this.info("setEnabled(" + isEnabled + "), focused widget is " + this.__focusedWidget);
+ cc = this;
+
+ if (!isEnabled)
+ {
+ var fh = qx.ui.core.FocusHandler.getInstance();
+ this.__focusedWidget = fh.getFocusedWidget();
+// if (this.__focusedWidget) this.__focusedWidget.blur();
+ }
+
this.__toolBar.setEnabled(isEnabled);
this.__table.setEnabled(isEnabled);
+
+ if (isEnabled)
+ {
+ var widget = this.__focusedWidget ? this.__focusedWidget : this.__table;
+ widget.blur();
+ widget.focus();
+ this.__focusedWidget = null;
+ }
},
__setEnabled : function()
@@ -5,6 +5,7 @@
#asset(cascadae/icon/16/files/folder-partical.png)
#asset(cascadae/icon/16/files/folder-skipped.png)
#asset(cascadae/icon/16/files/office-skipped.png)
+#asset(qx/icon/Tango/16/mimetypes/office-document.png)
************************************************************************ */
@@ -38,6 +39,7 @@ qx.Class.define("cascadae.files.Tree",
construct : function()
{
+
var n2c =
{
"name" : this.tr("Name"),
@@ -106,6 +108,8 @@ qx.Class.define("cascadae.files.Tree",
this.setAlwaysShowOpenCloseSymbol(true);
// delay preloading
qx.event.Timer.once(this.__preloadImages, this, 3000);
+
+ this.setAppearance("file-tree");
},
members : {
@@ -10,6 +10,40 @@
qx.Theme.define("cascadae.theme.Appearance",
{
- extend : qx.theme.modern.Appearance,
- appearances : {}
+ extend : qx.theme.indigo.Appearance,
+ appearances : {
+ "file-tree" :
+ {
+ alias : "treevirtual",
+ include : "treevirtual",
+
+ style : function(states, style)
+ {
+ return {
+ // hide the border
+ padding: 0,
+ decorator: undefined
+ };
+ }
+ },
+ "table" :
+ {
+ style : function(states, style)
+ {
+ return {};
+ }
+ },
+
+ "table/statusbar" :
+ {
+ style : function(states)
+ {
+ return {
+ decorator : states.focused ? "focused-statusbar" : "statusbar",
+ padding : [2, 5]
+ };
+ }
+ }
+ }
});
+
@@ -25,7 +25,7 @@
*/
qx.Theme.define("cascadae.theme.Color",
{
- extend : qx.theme.modern.Color,
+ extend : qx.theme.indigo.Color,
colors :
{
// equal to "background-pane" and "background-odd"
@@ -10,6 +10,18 @@
qx.Theme.define("cascadae.theme.Decoration",
{
- extend : qx.theme.modern.Decoration,
- decorations : {}
+ extend : qx.theme.indigo.Decoration,
+ decorations : {
+ "focused-statusbar" :
+ {
+ decorator : qx.ui.decoration.Single,
+
+ style :
+ {
+ widthTop : 1,
+ colorTop : "background-selected",
+ styleTop : "solid"
+ }
+ }
+ }
});
@@ -14,6 +14,7 @@ qx.Theme.define("cascadae.theme.Font",
fonts : {
"default" : { },
"bold" : { },
- "small" : { }
+ "small" : { },
+ "headline" : { size: 12 }
}
});

0 comments on commit bdbb10e

Please sign in to comment.