From 37544b45d583bfed23bd17d5f9ef4516a7aafab8 Mon Sep 17 00:00:00 2001 From: Itay Cohen Date: Sat, 1 Feb 2020 17:54:36 +0200 Subject: [PATCH] Don't set comments to vertical when resizing (#2045) --- src/widgets/CommentsWidget.cpp | 15 --------------- src/widgets/CommentsWidget.h | 3 --- src/widgets/FunctionsWidget.cpp | 15 --------------- src/widgets/FunctionsWidget.h | 3 --- 4 files changed, 36 deletions(-) diff --git a/src/widgets/CommentsWidget.cpp b/src/widgets/CommentsWidget.cpp index dac006d85..8a7150f95 100644 --- a/src/widgets/CommentsWidget.cpp +++ b/src/widgets/CommentsWidget.cpp @@ -4,7 +4,6 @@ #include "common/Helpers.h" #include -#include #include CommentsModel::CommentsModel(QList *comments, @@ -287,20 +286,6 @@ void CommentsWidget::showTitleContextMenu(const QPoint &pt) titleContextMenu->exec(this->mapToGlobal(pt)); } -void CommentsWidget::resizeEvent(QResizeEvent *event) -{ - if (mainWindow->responsive && isVisible()) { - if (event->size().width() >= event->size().height()) { - // Set horizontal view (list) - actionHorizontal.setChecked(true); - } else { - // Set vertical view (Tree) - actionVertical.setChecked(true); - } - } - QDockWidget::resizeEvent(event); -} - void CommentsWidget::refreshTree() { commentsModel->beginResetModel(); diff --git a/src/widgets/CommentsWidget.h b/src/widgets/CommentsWidget.h index 2645c8d79..395e30c2d 100644 --- a/src/widgets/CommentsWidget.h +++ b/src/widgets/CommentsWidget.h @@ -78,9 +78,6 @@ class CommentsWidget : public ListDockWidget explicit CommentsWidget(MainWindow *main, QAction *action = nullptr); ~CommentsWidget() override; -protected: - void resizeEvent(QResizeEvent *event) override; - private slots: void onActionHorizontalToggled(bool checked); void onActionVerticalToggled(bool checked); diff --git a/src/widgets/FunctionsWidget.cpp b/src/widgets/FunctionsWidget.cpp index 7afc8b78a..4f5d19e8c 100644 --- a/src/widgets/FunctionsWidget.cpp +++ b/src/widgets/FunctionsWidget.cpp @@ -16,7 +16,6 @@ #include #include #include -#include namespace { @@ -580,20 +579,6 @@ void FunctionsWidget::onActionVerticalToggled(bool enable) } } -void FunctionsWidget::resizeEvent(QResizeEvent *event) -{ - if (mainWindow->responsive && isVisible()) { - if (event->size().width() >= event->size().height()) { - // Set horizontal view (list) - actionHorizontal.setChecked(true); - } else { - // Set vertical view (Tree) - actionVertical.setChecked(true); - } - } - QDockWidget::resizeEvent(event); -} - /** * @brief a SLOT to set the stylesheet for a tooltip */ diff --git a/src/widgets/FunctionsWidget.h b/src/widgets/FunctionsWidget.h index d553f97d5..eaaa816e1 100644 --- a/src/widgets/FunctionsWidget.h +++ b/src/widgets/FunctionsWidget.h @@ -105,9 +105,6 @@ private slots: void setTooltipStylesheet(); void refreshTree(); -protected: - void resizeEvent(QResizeEvent *event) override; - private: QSharedPointer task; QList functions;