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 <QMenu>
#include <QResizeEvent>
#include <QShortcut>
CommentsModel::CommentsModel(QList<CommentDescription> *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();

View File

@ -78,9 +78,6 @@ public:
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);

View File

@ -16,7 +16,6 @@
#include <QShortcut>
#include <QJsonArray>
#include <QJsonObject>
#include <QResizeEvent>
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
*/

View File

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