aboutsummaryrefslogtreecommitdiff
path: root/src/FbWinFrame.cc
diff options
context:
space:
mode:
Diffstat (limited to 'src/FbWinFrame.cc')
-rw-r--r--src/FbWinFrame.cc22
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
384void FbWinFrame::moveLabelButtonLeftOf(FbTk::TextButton &btn, const FbTk::TextButton &dest) { 384void 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
392void FbWinFrame::moveLabelButtonRightOf(FbTk::TextButton &btn, const FbTk::TextButton &dest) { 398void 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
400void FbWinFrame::setLabelButtonFocus(FbTk::TextButton &btn) { 410void FbWinFrame::setLabelButtonFocus(FbTk::TextButton &btn) {