Revision: 2396
http://vexi.svn.sourceforge.net/vexi/?rev=2396&view=rev
Author: clrg
Date: 2007-10-01 16:05:48 -0700 (Mon, 01 Oct 2007)
Log Message:
-----------
Improve tab, tabpane layout
Modified Paths:
--------------
trunk/widgets/org.vexi.widgets/src/org/vexi/theme/win2k/tab.t
trunk/widgets/org.vexi.widgets/src/org/vexi/theme/win2k/tabpane.t
Modified: trunk/widgets/org.vexi.widgets/src/org/vexi/theme/win2k/tab.t
===================================================================
--- trunk/widgets/org.vexi.widgets/src/org/vexi/theme/win2k/tab.t
2007-10-01 23:01:12 UTC (rev 2395)
+++ trunk/widgets/org.vexi.widgets/src/org/vexi/theme/win2k/tab.t
2007-10-01 23:05:48 UTC (rev 2396)
@@ -7,8 +7,8 @@
</meta:doc>
<lib:tab />
- <ui:box redirect=":$content" layout="place">
- <bevel id="bg" align="topleft" fill="#c4c0b8" form="tabtop" y="2"
shrink="true">
+ <ui:box redirect=":$content" align="center" layout="layer" shrink="true">
+ <bevel id="bg" align="topleft" form="tabtop">
<lay:pad padding="3">
<focusborder id="focus">
<lay:pad padding="2 6">
@@ -27,24 +27,31 @@
thisbox.selected ++= static.selectedFunc;
thisbox.focused ++= .focusborder..focusFunc;
- $bg.height ++= function(v) { height = v - 2; cascade = v; }
- $bg.width ++= function(v) { width = v; cascade = v; }
-
rdrt..addRedirect(thisbox, $content, "orient", "font", "fontsize",
"text", "textcolor");
+ // initialise
+ selected = false;
+
</ui:box>
/** 'raise' when selected */
- static.selectedFunc = function(v)
- {
+ static.selectedFunc = function(v) {
cascade = v;
- trapee.th_bg.fill = trapee.selected ? "#d4d0c8" : "#c4c0b8";
- trapee.th_bg.y = trapee.selected ? 0 : 2;
+ var t = trapee;
+ var b = t.th_bg;
+ if (t.selected) {
+ b.fill = "#d4d0c8";
+ b[0].padding = 3;
+ b.y = 0;
+ } else {
+ b.fill = "#c4c0b8";
+ b[0].padding = "1 3";
+ b.y = 2;
+ }
}
/** adjust textcolor depending on enabled state */
- static.enabledFunc = function(v)
- {
+ static.enabledFunc = function(v) {
cascade = v;
trapee.th_content.textcolor = trapee.enabled ? "black" : "#888888";
}
Modified: trunk/widgets/org.vexi.widgets/src/org/vexi/theme/win2k/tabpane.t
===================================================================
--- trunk/widgets/org.vexi.widgets/src/org/vexi/theme/win2k/tabpane.t
2007-10-01 23:01:12 UTC (rev 2395)
+++ trunk/widgets/org.vexi.widgets/src/org/vexi/theme/win2k/tabpane.t
2007-10-01 23:05:48 UTC (rev 2396)
@@ -6,38 +6,33 @@
</meta:doc>
<lib:tabpane />
- <ui:box redirect=":$content" margin="10" padding="10">
- <ui:box id="body" layout="place">
- <ui:box id="wrap" align="topleft" minheight="27" vshrink="true">
- <ui:box id="leftwrap" shrink="true" display="false">
- <ui:box width="3" />
- <button id="left" fill="#d4d0c8" width="16" height="16">
- <ui:box layout="place"><ui:box align="center"
fill=":.image.arrowleft" shrink="true" /></ui:box>
- </button>
- <ui:box width="3" />
- </ui:box>
- <ui:box id="headwrap" layout="place">
- <ui:box id="head" align="topleft" hshrink="true" />
- </ui:box>
- <ui:box id="rightwrap" shrink="true" display="false">
- <ui:box width="3" />
- <button id="right" fill="#d4d0c8" width="16" height="16">
- <ui:box layout="place"><ui:box align="center"
fill=":.image.arrowright" shrink="true" /></ui:box>
- </button>
- <ui:box width="3" />
- </ui:box>
- <ui:box id="closewrap" shrink="true" display="false">
- <ui:box width="3" />
- <button id="close" fill="#d4d0c8" width="16" height="16">
- <ui:box layout="place"><ui:box align="center"
fill=":.image.close" shrink="true" /></ui:box>
- </button>
- <ui:box width="3" />
- </ui:box>
+ <ui:box redirect=":$content" layout="place" minwidth="100" minheight="100">
+ <bevel id="content" align="topleft" form="up" thickness="2" y="27" />
+ <ui:box id="wrap" align="topleft" minheight="29" vshrink="true">
+ <ui:box id="leftwrap" shrink="true" display="false">
+ <ui:box width="3" />
+ <button id="left" fill="#d4d0c8" width="16" height="16">
+ <ui:box layout="place"><ui:box align="center"
fill=":.image.arrowleft" shrink="true" /></ui:box>
+ </button>
+ <ui:box width="3" />
</ui:box>
- <bevel align="topleft" form="up" thickness="2" y="27">
- <ui:box id="content" />
- </bevel>
- <ui:box id="shadow" align="topleft" fill="#d4d0c8" height="2"
y="27" />
+ <ui:box id="headwrap" layout="place">
+ <ui:box id="head" align="topleft" hshrink="true" />
+ </ui:box>
+ <ui:box id="rightwrap" shrink="true" display="false">
+ <ui:box width="3" />
+ <button id="right" fill="#d4d0c8" width="16" height="16">
+ <ui:box layout="place"><ui:box align="center"
fill=":.image.arrowright" shrink="true" /></ui:box>
+ </button>
+ <ui:box width="3" />
+ </ui:box>
+ <ui:box id="closewrap" shrink="true" display="false">
+ <ui:box width="3" />
+ <button id="close" fill="#d4d0c8" width="16" height="16">
+ <ui:box layout="place"><ui:box align="center"
fill=":.image.close" shrink="true" /></ui:box>
+ </button>
+ <ui:box width="3" />
+ </ui:box>
</ui:box>
thisbox.th_close = $close;
@@ -46,22 +41,6 @@
thisbox.th_next = $right;
thisbox.th_prev = $left;
- /** sync shadow with currently selected tab - show.v_tab */
- var syncShadow = function(v)
- {
- var dx = $wrap.distanceto(show.v_tab).x;
- $shadow.x = dx + 1;
- $shadow.y = $wrap.height;
- $shadow.width = vexi.math.max(0, vexi.math.min(width - dx,
show.v_tab.width) - 3);
- }
-
- /** trap function to fire syncShadow */
- var syncShadowFunc = function(v)
- {
- cascade = v;
- syncShadow();
- }
-
/** sync $head and button displays with tabs */
var syncHead = function(v)
{
@@ -74,7 +53,6 @@
else $head.x =
vexi.math.min(vexi.math.max($head.x, -show.v_tab.x),
$headwrap.width - (show.v_tab.width +
show.v_tab.x));
- syncShadow();
}
/** trap function to fire syncHead */
@@ -85,16 +63,13 @@
}
/** keep display updated to current tab */
- thisbox.show ++= function(c)
- {
- if (show)
- {
+ thisbox.show ++= function(c) {
+ if (show) {
show.v_tab.width --= syncHeadFunc;
show.v_tab.x --= syncHeadFunc;
}
cascade = c;
- if (c and c.v_tab)
- {
+ if (c and c.v_tab) {
c.v_tab.width ++= syncHeadFunc;
c.v_tab.x ++= syncHeadFunc;
}
@@ -103,7 +78,6 @@
// general trap function assignments
thisbox.show ++= syncHeadFunc;
$head.width ++= syncHeadFunc;
- $head.x ++= syncShadowFunc;
$headwrap.width ++= syncHeadFunc;
$headwrap.x ++= syncHeadFunc;
This was sent by the SourceForge.net collaborative development platform, the
world's largest Open Source development site.
-------------------------------------------------------------------------
This SF.net email is sponsored by: Microsoft
Defy all challenges. Microsoft(R) Visual Studio 2005.
http://clk.atdmt.com/MRT/go/vse0120000070mrt/direct/01/
_______________________________________________
Vexi-svn mailing list
[email protected]
https://lists.sourceforge.net/lists/listinfo/vexi-svn