Don't set comments to vertical when resizing (#2045)

This commit is contained in:
Itay Cohen 2020-02-01 17:54:36 +02:00 committed by GitHub
parent cf65c0304a
commit 37544b45d5
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23
4 changed files with 0 additions and 36 deletions

View File

@ -4,7 +4,6 @@
#include "common/Helpers.h" #include "common/Helpers.h"
#include <QMenu> #include <QMenu>
#include <QResizeEvent>
#include <QShortcut> #include <QShortcut>
CommentsModel::CommentsModel(QList<CommentDescription> *comments, CommentsModel::CommentsModel(QList<CommentDescription> *comments,
@ -287,20 +286,6 @@ void CommentsWidget::showTitleContextMenu(const QPoint &pt)
titleContextMenu->exec(this->mapToGlobal(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() void CommentsWidget::refreshTree()
{ {
commentsModel->beginResetModel(); commentsModel->beginResetModel();

View File

@ -78,9 +78,6 @@ public:
explicit CommentsWidget(MainWindow *main, QAction *action = nullptr); explicit CommentsWidget(MainWindow *main, QAction *action = nullptr);
~CommentsWidget() override; ~CommentsWidget() override;
protected:
void resizeEvent(QResizeEvent *event) override;
private slots: private slots:
void onActionHorizontalToggled(bool checked); void onActionHorizontalToggled(bool checked);
void onActionVerticalToggled(bool checked); void onActionVerticalToggled(bool checked);

View File

@ -16,7 +16,6 @@
#include <QShortcut> #include <QShortcut>
#include <QJsonArray> #include <QJsonArray>
#include <QJsonObject> #include <QJsonObject>
#include <QResizeEvent>
namespace { 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 * @brief a SLOT to set the stylesheet for a tooltip
*/ */

View File

@ -105,9 +105,6 @@ private slots:
void setTooltipStylesheet(); void setTooltipStylesheet();
void refreshTree(); void refreshTree();
protected:
void resizeEvent(QResizeEvent *event) override;
private: private:
QSharedPointer<FunctionsTask> task; QSharedPointer<FunctionsTask> task;
QList<FunctionDescription> functions; QList<FunctionDescription> functions;