external tab fixes, plus aligning items properly

This commit is contained in:
simonb 2006-03-23 02:06:51 +00:00
parent 15f53b5556
commit ffae659b3e
5 changed files with 33 additions and 23 deletions

View file

@ -1,5 +1,9 @@
(Format: Year/Month/Day)
Changes for 0.9.16:
*06/03/23:
* Fix some tab stacking alignment and rendering on tab resize (Simon)
(and very minor tidying)
FbWinFrame.cc FbTk/XLayer.cc FbTk/XLayerItem.hh/cc
*06/03/22:
* More external tabs work (Simon)
- Can now be placed TopLeft/TopRight/BottomLeft/BottomRight

View file

@ -131,24 +131,33 @@ void XLayer::stackBelowItem(XLayerItem *item, XLayerItem *above) {
}
// We can't just use Restack here, because it won't do anything if they're
// already in the same relative order excluding other windows
void XLayer::alignItem(XLayerItem &item) {
// Note: some other things effectively assume that the window list is
// sorted from highest to lowest
size_t winnum = 0,
num = item.numWindows();
Window *winlist = new Window[num];
// fill the rest of the array
XLayerItem::Windows::iterator it = item.getWindows().begin();
XLayerItem::Windows::iterator it_end = item.getWindows().end();
for (; it != it_end; ++it) {
if ((*it)->window()) {
winlist[winnum++] = (*it)->window();
}
if (itemList().front() == &item) {
stackBelowItem(&item, m_manager.getLowestItemAboveLayer(m_layernum));
return;
}
XRestackWindows(FbTk::App::instance()->display(), winlist, winnum);
delete [] winlist;
// Note: some other things effectively assume that the window list is
// sorted from highest to lowest
// get our item
iterator myit = std::find(itemList().begin(), itemList().end(), &item);
iterator it = myit;
// go to the one above it in our layer (top is front, so we decrement)
--it;
// keep going until we find one that is currently visible to the user
while (it != itemList().begin() && !(*it)->visible())
--it;
if (it == itemList().begin() && !(*it)->visible())
// reached front item, but it wasn't visible, therefore it was already raised
stackBelowItem(&item, m_manager.getLowestItemAboveLayer(m_layernum));
else
stackBelowItem(&item, *it);
}
XLayer::iterator XLayer::insert(XLayerItem &item, unsigned int pos) {

View file

@ -28,7 +28,7 @@
using namespace FbTk;
XLayerItem::XLayerItem(FbWindow &win, XLayer &layer) :
m_layer(&layer), m_layeriterator(0) {
m_layer(&layer) {
m_windows.push_front(&win);
m_layer->insert(*this);
}

View file

@ -79,7 +79,6 @@ public:
private:
XLayer *m_layer;
XLayer::iterator m_layeriterator;
Windows m_windows;
};

View file

@ -207,10 +207,12 @@ bool FbWinFrame::setTabMode(TabMode tabmode) {
applyTabContainer();
m_tab_container.clear();
m_tab_container.raise();
m_tab_container.show();
if (!m_use_tabs)
m_tab_container.show();
else
ret = false;
m_label.hide();
// reconfigure();
}
@ -1296,10 +1298,6 @@ void FbWinFrame::init() {
m_label.setEventMask(ExposureMask | ButtonPressMask |
ButtonReleaseMask | ButtonMotionMask |
EnterWindowMask);
m_label.show();
m_tab_container.show();
m_tab_container.raise();
showHandle();
showTitlebar();