|
From: Joe E. <jen...@fl...> - 2006-08-18 15:14:07
|
[ Cc: tktable-tile-dev, as this is probably of general interest ]
Georgios Petasis wrote:
> I am not sure I have understood how to develop tab elements in tile themes.
> In my tileqt extension I need to draw "outside" of a tab area when
> when a tab is raised. In the current implementation, I simply draw outside.
> This worked for some earlier versions of tile, but not with the latest ones.
Hm. Drawing outside the tab's bounding box should still work,
don't know why it doesn't. But see below for more.
> Can you please explain in a few words how tabs that expand should be
> drawn? Tabs is the last thing that I have to fix in order to release
> tileqt 0.4 [...]
Notebook tab placement in 0.7.6 is a bit more flexible than
it was before. The layout is controlled by the "-tabposition"
and "-tabmargins" TNotebook style options, and the "-expand"
TNotebook.Tab style option.
"-tabposition" is a labelanchor string, as in the labelframe widget,
specifying where to place the tabs. Default is "nw", or you can use
"n" to get centered tabs like in (old-style) Aqua notebooks.
"-tabmargins" and "-expand" are both padding specifications.
The notebook adds "-tabmargins" padding outside the tab row as a
whole, and "-expand" specifies how much to stretch individual tabs.
("-expand" is like [grid]'s "-ipadx" and "-ipady" options, except
that the extra space is allocated outside the parcel instead
of inside.)
So for example: to make the selected tab overlap the notebook
border, you could use:
style default TNotebook -borderwidth 2
style map TNotebook.Tab -expand [list selected {0 0 0 2}]
To make the selected tab overlap its neighbors and expand upwards
into the margins (like on Windows XP) you could use:
style default TNotebook -tabmargins {2 2 2 0} -tabposition nw
style map TNotebook.Tab -expand [list selected {2 2 2 0}]
You can also adjust the Tab "-padding" option to get different
effects -- add extra padding at the bottom of the selected tab
to make the label "pop up" (as in the "alt" theme), or add it
at the top to keep the baseline aligned (as in the "clam" theme).
* * *
A few more things are still needed to support all the common
notebook styles. For "-tabposition [ew]*", the notebook should
pack tabs from top to bottom instead of left to right. Themes
need to define separate layouts for left-, right-, and bottom-
side tabs. There should be something like the ttk::labelframe's
"-labeloutside false" to get (new-style) Aqua tabs that are
centered on the client pane border; and there needs to be a
way to distinguish the first and last tabs (again for new-style
Aqua tabs).
--Joe English
jen...@fl...
|