summary refs log tree commit diff
path: root/src/Splitter.cc
diff options
context:
space:
mode:
authorKonstantinos Sideris <sideris.konstantin@gmail.com>2017-05-19 19:55:38 +0300
committerKonstantinos Sideris <sideris.konstantin@gmail.com>2017-05-19 19:55:38 +0300
commitc480f8f4bcef551eddcddeb5a4304de33c146732 (patch)
treef405592f095083723077243e618b7a3b7b462a3c /src/Splitter.cc
parentRemove RoomList UI form (diff)
downloadnheko-c480f8f4bcef551eddcddeb5a4304de33c146732.tar.xz
Snappy sidebar
Diffstat (limited to 'src/Splitter.cc')
-rw-r--r--src/Splitter.cc21
1 files changed, 8 insertions, 13 deletions
diff --git a/src/Splitter.cc b/src/Splitter.cc

index 0a3ea416..2564c434 100644 --- a/src/Splitter.cc +++ b/src/Splitter.cc
@@ -18,11 +18,10 @@ #include <QDebug> #include "Splitter.h" +#include "Theme.h" -Splitter::Splitter(int first_step, int second_step, QWidget *parent) +Splitter::Splitter(QWidget *parent) : QSplitter(parent) - , firstStep_{first_step} - , secondStep_{second_step} { connect(this, &QSplitter::splitterMoved, this, &Splitter::onSplitterMoved); } @@ -39,7 +38,7 @@ void Splitter::onSplitterMoved(int pos, int index) return; } - if (s[0] == secondStep_) { + if (s[0] == ui::sidebar::NormalSize) { rightMoveCount_ += 1; if (rightMoveCount_ > moveEventLimit_) { @@ -49,15 +48,13 @@ void Splitter::onSplitterMoved(int pos, int index) // if we are coming from the right, the cursor should // end up on the first widget. if (left->rect().contains(pos)) { - qDebug() << "Resizing left"; - - left->setMinimumWidth(firstStep_); - left->setMaximumWidth(firstStep_); + left->setMinimumWidth(ui::sidebar::SmallSize); + left->setMaximumWidth(ui::sidebar::SmallSize); rightMoveCount_ = 0; } } - } else if (s[0] == firstStep_) { + } else if (s[0] == ui::sidebar::SmallSize) { leftMoveCount_ += 1; if (leftMoveCount_ > moveEventLimit_) { @@ -72,10 +69,8 @@ void Splitter::onSplitterMoved(int pos, int index) // if we are coming from the left, the cursor should // end up on the second widget. if (extended.contains(pos)) { - qDebug() << "Resizing Right"; - - left->setMinimumWidth(secondStep_); - left->setMaximumWidth(2 * secondStep_); + left->setMinimumWidth(ui::sidebar::NormalSize); + left->setMaximumWidth(2 * ui::sidebar::NormalSize); leftMoveCount_ = 0; }