Skip to content

Commit

Permalink
Move to the indigo theme. Add a focus indicator for a table.
Browse files Browse the repository at this point in the history
  • Loading branch information
arcusfelis committed Mar 20, 2013
1 parent 7d7ab75 commit bdbb10e
Show file tree
Hide file tree
Showing 8 changed files with 83 additions and 8 deletions.
3 changes: 2 additions & 1 deletion config.json
Expand Up @@ -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
Expand Down
5 changes: 5 additions & 0 deletions q_src/class/cascadae/Application.js
Expand Up @@ -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"))
// {
Expand All @@ -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 });
},

Expand Down
20 changes: 19 additions & 1 deletion q_src/class/cascadae/Container.js
Expand Up @@ -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);
Expand Down Expand Up @@ -447,6 +446,7 @@ qx.Class.define("cascadae.Container",
this.__logTable.setActive(true);
},

__focusedWidget: null,

/**
* TODOC
Expand All @@ -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()
Expand Down
4 changes: 4 additions & 0 deletions q_src/class/cascadae/files/Tree.js
Expand Up @@ -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)
************************************************************************ */

Expand Down Expand Up @@ -38,6 +39,7 @@ qx.Class.define("cascadae.files.Tree",

construct : function()
{

var n2c =
{
"name" : this.tr("Name"),
Expand Down Expand Up @@ -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 : {
Expand Down
38 changes: 36 additions & 2 deletions q_src/class/cascadae/theme/Appearance.js
Expand Up @@ -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]
};
}
}
}
});

2 changes: 1 addition & 1 deletion q_src/class/cascadae/theme/Color.js
Expand Up @@ -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"
Expand Down
16 changes: 14 additions & 2 deletions q_src/class/cascadae/theme/Decoration.js
Expand Up @@ -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"
}
}
}
});
3 changes: 2 additions & 1 deletion q_src/class/cascadae/theme/Font.js
Expand Up @@ -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.