Commit 7ea3e2c2 authored by Daniel Teske's avatar Daniel Teske Committed by Daniel Molkentin
Browse files

Make target selector popup size smart

Task-number: QTCREATORBUG-7705

Change-Id: Ica9a39f0557993a8bba6ec32f7373101203af4c0
Reviewed-by: default avatarDaniel Molkentin <>
parent 1faea8a0
...@@ -58,13 +58,18 @@ class ListWidget : public QListWidget ...@@ -58,13 +58,18 @@ class ListWidget : public QListWidget
public: public:
ListWidget(QWidget *parent); ListWidget(QWidget *parent);
QSize sizeHint() const;
void keyPressEvent(QKeyEvent *event); void keyPressEvent(QKeyEvent *event);
void keyReleaseEvent(QKeyEvent *event); void keyReleaseEvent(QKeyEvent *event);
void setMaxCount(int maxCount); void setMaxCount(int maxCount);
int maxCount();
int optimalWidth() const;
void setOptimalWidth(int width);
int padding();
private: private:
int m_maxCount; int m_maxCount;
int m_optimalWidth;
}; };
class ProjectListWidget : public ListWidget class ProjectListWidget : public ListWidget
...@@ -115,7 +120,7 @@ public: ...@@ -115,7 +120,7 @@ public:
void keyPressEvent(QKeyEvent *ke); void keyPressEvent(QKeyEvent *ke);
void keyReleaseEvent(QKeyEvent *ke); void keyReleaseEvent(QKeyEvent *ke);
QSize sizeHint() const; bool event(QEvent *event);
public slots: public slots:
void toggleVisible(); void toggleVisible();
void nextOrShow(); void nextOrShow();
...@@ -163,10 +168,13 @@ private: ...@@ -163,10 +168,13 @@ private:
void updateDeployListVisible(); void updateDeployListVisible();
void updateRunListVisible(); void updateRunListVisible();
void updateSummary(); void updateSummary();
void updateSeparatorVisible();
void paintEvent(QPaintEvent *); void paintEvent(QPaintEvent *);
void mousePressEvent(QMouseEvent *); void mousePressEvent(QMouseEvent *);
void doLayout(bool keepSize);
QVector<int> listWidgetWidths(int minSize, int maxSize);
QWidget *createTitleLabel(const QString &text);
QAction *m_projectAction; QAction *m_projectAction;
SessionManager *m_sessionManager; SessionManager *m_sessionManager;
...@@ -174,7 +182,6 @@ private: ...@@ -174,7 +182,6 @@ private:
ProjectListWidget *m_projectListWidget; ProjectListWidget *m_projectListWidget;
QVector<GenericListWidget *> m_listWidgets; QVector<GenericListWidget *> m_listWidgets;
QVector<QWidget *> m_titleWidgets; QVector<QWidget *> m_titleWidgets;
QVector<QWidget *> m_separators;
QLabel *m_summaryLabel; QLabel *m_summaryLabel;
Project *m_project; Project *m_project;
Markdown is supported
0% or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment