diff options
author | mathias <mathias> | 2005-10-19 04:46:05 (GMT) |
---|---|---|
committer | mathias <mathias> | 2005-10-19 04:46:05 (GMT) |
commit | 4dec832b6bcef0503ac092a8cfdc370ab65f8f8f (patch) | |
tree | 41dfe4d023ca4ff300e6f82888164c657e943b32 /src | |
parent | 97aa10ece46fa9b29edb66eeefd5abd34b30def8 (diff) | |
download | fluxbox_paul-4dec832b6bcef0503ac092a8cfdc370ab65f8f8f.zip fluxbox_paul-4dec832b6bcef0503ac092a8cfdc370ab65f8f8f.tar.bz2 |
Fixed reordering of tabs, patch from Rob Stevens
Diffstat (limited to 'src')
-rw-r--r-- | src/FbWinFrame.cc | 22 | ||||
-rw-r--r-- | src/FbWinFrame.hh | 4 | ||||
-rw-r--r-- | src/Window.cc | 10 |
3 files changed, 25 insertions, 11 deletions
diff --git a/src/FbWinFrame.cc b/src/FbWinFrame.cc index 53d1d2c..b2ce864 100644 --- a/src/FbWinFrame.cc +++ b/src/FbWinFrame.cc | |||
@@ -382,19 +382,29 @@ void FbWinFrame::moveLabelButtonTo(FbTk::TextButton &btn, int x, int y) { | |||
382 | 382 | ||
383 | 383 | ||
384 | void FbWinFrame::moveLabelButtonLeftOf(FbTk::TextButton &btn, const FbTk::TextButton &dest) { | 384 | void FbWinFrame::moveLabelButtonLeftOf(FbTk::TextButton &btn, const FbTk::TextButton &dest) { |
385 | int pos = m_tab_container.find(&dest); | 385 | int dest_pos = m_tab_container.find(&dest); |
386 | if (pos < 0) | 386 | int cur_pos = m_tab_container.find(&btn); |
387 | if (dest_pos < 0 || cur_pos < 0) | ||
387 | return; | 388 | return; |
389 | int movement=dest_pos - cur_pos; | ||
390 | if(movement>0) | ||
391 | movement-=1; | ||
392 | // else | ||
393 | // movement-=1; | ||
388 | 394 | ||
389 | m_tab_container.moveItem(&btn, pos-1); | 395 | m_tab_container.moveItem(&btn, movement); |
390 | } | 396 | } |
391 | 397 | ||
392 | void FbWinFrame::moveLabelButtonRightOf(FbTk::TextButton &btn, const FbTk::TextButton &dest) { | 398 | void FbWinFrame::moveLabelButtonRightOf(FbTk::TextButton &btn, const FbTk::TextButton &dest) { |
393 | int pos = m_tab_container.find(&dest); | 399 | int dest_pos = m_tab_container.find(&dest); |
394 | if (pos < 0) | 400 | int cur_pos = m_tab_container.find(&btn); |
401 | if (dest_pos < 0 || cur_pos < 0 ) | ||
395 | return; | 402 | return; |
403 | int movement=dest_pos - cur_pos; | ||
404 | if(movement<0) | ||
405 | movement+=1; | ||
396 | 406 | ||
397 | m_tab_container.moveItem(&btn, pos+1); | 407 | m_tab_container.moveItem(&btn, movement); |
398 | } | 408 | } |
399 | 409 | ||
400 | void FbWinFrame::setLabelButtonFocus(FbTk::TextButton &btn) { | 410 | void FbWinFrame::setLabelButtonFocus(FbTk::TextButton &btn) { |
diff --git a/src/FbWinFrame.hh b/src/FbWinFrame.hh index 961e8c5..9b625fc 100644 --- a/src/FbWinFrame.hh +++ b/src/FbWinFrame.hh | |||
@@ -179,6 +179,10 @@ public: | |||
179 | inline FbTk::FbWindow &titlebar() { return m_titlebar; } | 179 | inline FbTk::FbWindow &titlebar() { return m_titlebar; } |
180 | inline const FbTk::FbWindow &label() const { return m_label; } | 180 | inline const FbTk::FbWindow &label() const { return m_label; } |
181 | inline FbTk::FbWindow &label() { return m_label; } | 181 | inline FbTk::FbWindow &label() { return m_label; } |
182 | |||
183 | inline const Container &tabcontainer() const { return m_tab_container; } | ||
184 | inline Container &tabcontainer() { return m_tab_container; } | ||
185 | |||
182 | /// @return clientarea window | 186 | /// @return clientarea window |
183 | inline const FbTk::FbWindow &clientArea() const { return m_clientarea; } | 187 | inline const FbTk::FbWindow &clientArea() const { return m_clientarea; } |
184 | inline FbTk::FbWindow &clientArea() { return m_clientarea; } | 188 | inline FbTk::FbWindow &clientArea() { return m_clientarea; } |
diff --git a/src/Window.cc b/src/Window.cc index 2190c5c..82df391 100644 --- a/src/Window.cc +++ b/src/Window.cc | |||
@@ -895,7 +895,7 @@ FluxboxWindow::ClientList::iterator FluxboxWindow::getClientInsertPosition(int x | |||
895 | int dest_x = 0, dest_y = 0; | 895 | int dest_x = 0, dest_y = 0; |
896 | Window labelbutton = 0; | 896 | Window labelbutton = 0; |
897 | if (!XTranslateCoordinates(FbTk::App::instance()->display(), | 897 | if (!XTranslateCoordinates(FbTk::App::instance()->display(), |
898 | parent().window(), frame().label().window(), | 898 | parent().window(), frame().tabcontainer().window(), |
899 | x, y, &dest_x, &dest_y, | 899 | x, y, &dest_x, &dest_y, |
900 | &labelbutton)) | 900 | &labelbutton)) |
901 | return m_clientlist.end(); | 901 | return m_clientlist.end(); |
@@ -915,7 +915,7 @@ FluxboxWindow::ClientList::iterator FluxboxWindow::getClientInsertPosition(int x | |||
915 | Window child_return=0; | 915 | Window child_return=0; |
916 | // make x and y relative to our labelbutton | 916 | // make x and y relative to our labelbutton |
917 | if (!XTranslateCoordinates(FbTk::App::instance()->display(), | 917 | if (!XTranslateCoordinates(FbTk::App::instance()->display(), |
918 | frame().label().window(), labelbutton, | 918 | frame().tabcontainer().window(), labelbutton, |
919 | dest_x, dest_y, &x, &y, | 919 | dest_x, dest_y, &x, &y, |
920 | &child_return)) | 920 | &child_return)) |
921 | return m_clientlist.end(); | 921 | return m_clientlist.end(); |
@@ -936,7 +936,7 @@ void FluxboxWindow::moveClientTo(WinClient &win, int x, int y) { | |||
936 | int dest_x = 0, dest_y = 0; | 936 | int dest_x = 0, dest_y = 0; |
937 | Window labelbutton = 0; | 937 | Window labelbutton = 0; |
938 | if (!XTranslateCoordinates(FbTk::App::instance()->display(), | 938 | if (!XTranslateCoordinates(FbTk::App::instance()->display(), |
939 | parent().window(), frame().label().window(), | 939 | parent().window(), frame().tabcontainer().window(), |
940 | x, y, &dest_x, &dest_y, | 940 | x, y, &dest_x, &dest_y, |
941 | &labelbutton)) | 941 | &labelbutton)) |
942 | return; | 942 | return; |
@@ -955,11 +955,11 @@ void FluxboxWindow::moveClientTo(WinClient &win, int x, int y) { | |||
955 | Window child_return = 0; | 955 | Window child_return = 0; |
956 | //make x and y relative to our labelbutton | 956 | //make x and y relative to our labelbutton |
957 | if (!XTranslateCoordinates(FbTk::App::instance()->display(), | 957 | if (!XTranslateCoordinates(FbTk::App::instance()->display(), |
958 | frame().label().window(), labelbutton, | 958 | frame().tabcontainer().window(), labelbutton, |
959 | dest_x, dest_y, &x, &y, | 959 | dest_x, dest_y, &x, &y, |
960 | &child_return)) | 960 | &child_return)) |
961 | return; | 961 | return; |
962 | if (x > (*it).second->width() / 2) | 962 | if (x > (*it).second->width() / 2) |
963 | moveClientRightOf(win, *it->first); | 963 | moveClientRightOf(win, *it->first); |
964 | else | 964 | else |
965 | moveClientLeftOf(win, *it->first); | 965 | moveClientLeftOf(win, *it->first); |