Add -Wshadow
This commit is contained in:
parent
6d474b77f1
commit
172d111d1c
@ -96,6 +96,7 @@ if(NOT MSVC)
|
|||||||
-Wall \
|
-Wall \
|
||||||
-Wextra \
|
-Wextra \
|
||||||
-Werror \
|
-Werror \
|
||||||
|
-Wshadow \
|
||||||
-pipe \
|
-pipe \
|
||||||
-pedantic \
|
-pedantic \
|
||||||
-fsized-deallocation \
|
-fsized-deallocation \
|
||||||
|
@ -88,12 +88,12 @@ Splitter::onSplitterMoved(int pos, int index)
|
|||||||
rightMoveCount_ += 1;
|
rightMoveCount_ += 1;
|
||||||
|
|
||||||
if (rightMoveCount_ > moveEventLimit_) {
|
if (rightMoveCount_ > moveEventLimit_) {
|
||||||
auto left = widget(0);
|
auto left = widget(0);
|
||||||
auto pos = left->mapFromGlobal(QCursor::pos());
|
auto cursorPosition = left->mapFromGlobal(QCursor::pos());
|
||||||
|
|
||||||
// if we are coming from the right, the cursor should
|
// if we are coming from the right, the cursor should
|
||||||
// end up on the first widget.
|
// end up on the first widget.
|
||||||
if (left->rect().contains(pos)) {
|
if (left->rect().contains(cursorPosition)) {
|
||||||
left->setMinimumWidth(ui::sidebar::SmallSize);
|
left->setMinimumWidth(ui::sidebar::SmallSize);
|
||||||
left->setMaximumWidth(ui::sidebar::SmallSize);
|
left->setMaximumWidth(ui::sidebar::SmallSize);
|
||||||
|
|
||||||
@ -104,9 +104,9 @@ Splitter::onSplitterMoved(int pos, int index)
|
|||||||
leftMoveCount_ += 1;
|
leftMoveCount_ += 1;
|
||||||
|
|
||||||
if (leftMoveCount_ > moveEventLimit_) {
|
if (leftMoveCount_ > moveEventLimit_) {
|
||||||
auto left = widget(0);
|
auto left = widget(0);
|
||||||
auto right = widget(1);
|
auto right = widget(1);
|
||||||
auto pos = right->mapFromGlobal(QCursor::pos());
|
auto cursorPosition = right->mapFromGlobal(QCursor::pos());
|
||||||
|
|
||||||
// We move the start a little further so the transition isn't so abrupt.
|
// We move the start a little further so the transition isn't so abrupt.
|
||||||
auto extended = right->rect();
|
auto extended = right->rect();
|
||||||
@ -114,7 +114,7 @@ Splitter::onSplitterMoved(int pos, int index)
|
|||||||
|
|
||||||
// if we are coming from the left, the cursor should
|
// if we are coming from the left, the cursor should
|
||||||
// end up on the second widget.
|
// end up on the second widget.
|
||||||
if (extended.contains(pos) &&
|
if (extended.contains(cursorPosition) &&
|
||||||
right->size().width() >=
|
right->size().width() >=
|
||||||
conf::sideBarCollapsePoint + ui::sidebar::NormalSize) {
|
conf::sideBarCollapsePoint + ui::sidebar::NormalSize) {
|
||||||
left->setMinimumWidth(ui::sidebar::NormalSize);
|
left->setMinimumWidth(ui::sidebar::NormalSize);
|
||||||
|
Loading…
Reference in New Issue
Block a user