Skip to content

Commit

Permalink
Don't set comments to vertical when resizing (#2045)
Browse files Browse the repository at this point in the history
  • Loading branch information
ITAYC0HEN committed Feb 1, 2020
1 parent cf65c03 commit 37544b4
Show file tree
Hide file tree
Showing 4 changed files with 0 additions and 36 deletions.
15 changes: 0 additions & 15 deletions src/widgets/CommentsWidget.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -4,7 +4,6 @@
#include "common/Helpers.h"

#include <QMenu>
#include <QResizeEvent>
#include <QShortcut>

CommentsModel::CommentsModel(QList<CommentDescription> *comments,
Expand Down Expand Up @@ -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();
Expand Down
3 changes: 0 additions & 3 deletions src/widgets/CommentsWidget.h
Original file line number Diff line number Diff line change
Expand Up @@ -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);
Expand Down
15 changes: 0 additions & 15 deletions src/widgets/FunctionsWidget.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -16,7 +16,6 @@
#include <QShortcut>
#include <QJsonArray>
#include <QJsonObject>
#include <QResizeEvent>

namespace {

Expand Down Expand Up @@ -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
*/
Expand Down
3 changes: 0 additions & 3 deletions src/widgets/FunctionsWidget.h
Original file line number Diff line number Diff line change
Expand Up @@ -105,9 +105,6 @@ private slots:
void setTooltipStylesheet();
void refreshTree();

protected:
void resizeEvent(QResizeEvent *event) override;

private:
QSharedPointer<FunctionsTask> task;
QList<FunctionDescription> functions;
Expand Down

0 comments on commit 37544b4

Please sign in to comment.