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/FbWinFrame.cc | |
parent | 97aa10ece46fa9b29edb66eeefd5abd34b30def8 (diff) | |
download | fluxbox_pavel-4dec832b6bcef0503ac092a8cfdc370ab65f8f8f.zip fluxbox_pavel-4dec832b6bcef0503ac092a8cfdc370ab65f8f8f.tar.bz2 |
Fixed reordering of tabs, patch from Rob Stevens
Diffstat (limited to 'src/FbWinFrame.cc')
-rw-r--r-- | src/FbWinFrame.cc | 22 |
1 files changed, 16 insertions, 6 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) { |