Commit dc8266d5 authored by Christoffer Ackelman's avatar Christoffer Ackelman

QT: Ge: Fixed DropDown boxes in toolbar.

parent ba96fda8
...@@ -227,14 +227,11 @@ QAction* addCheckableToolItem(QObject* parent, QToolBar* tools, ...@@ -227,14 +227,11 @@ QAction* addCheckableToolItem(QObject* parent, QToolBar* tools,
return action; return action;
} }
QMenu* addToolMenu(QWidget* parent, QToolBar* tools, const char* text) QComboBox* addToolMenu(QWidget* parent, QToolBar* tools, const char* callback)
{ {
QToolButton* button = new QToolButton(parent); QComboBox* menu = new QComboBox(parent);
button->setText(translate_utf8(text)); QObject::connect(menu, SIGNAL(activated(int)), parent, callback);
button->setPopupMode(QToolButton::InstantPopup); tools->addWidget(menu);
QMenu* menu = new QMenu(button);
button->setMenu(menu);
tools->addWidget(button);
return menu; return menu;
} }
......
...@@ -38,6 +38,7 @@ ...@@ -38,6 +38,7 @@
#define QT_HELPERS_H #define QT_HELPERS_H
#include <QAction> #include <QAction>
#include <QComboBox>
#include <QLabel> #include <QLabel>
#include <QSplitter> #include <QSplitter>
#include <QStatusBar> #include <QStatusBar>
...@@ -89,7 +90,7 @@ QAction* addToolItem(QObject* parent, QToolBar* tools, const char* text, ...@@ -89,7 +90,7 @@ QAction* addToolItem(QObject* parent, QToolBar* tools, const char* text,
const char* callback, const char* iconName); const char* callback, const char* iconName);
QAction* addCheckableToolItem(QObject* parent, QToolBar* tools, QAction* addCheckableToolItem(QObject* parent, QToolBar* tools,
const char* text, const char* callback, const char* iconName); const char* text, const char* callback, const char* iconName);
QMenu* addToolMenu(QWidget* parent, QToolBar* tools, const char* text); QComboBox* addToolMenu(QWidget* parent, QToolBar* tools, const char* callback);
QWidget* layout_to_widget(QLayout* layout); QWidget* layout_to_widget(QLayout* layout);
void set_pane_position(QSplitter* pane, int right); void set_pane_position(QSplitter* pane, int right);
QFrame* separator(QFrame::Shape shape); QFrame* separator(QFrame::Shape shape);
......
This diff is collapsed.
...@@ -42,6 +42,7 @@ ...@@ -42,6 +42,7 @@
#include "ge.h" #include "ge.h"
#include <QAction> #include <QAction>
#include <QComboBox>
#include <QLabel> #include <QLabel>
#include <QSplitter> #include <QSplitter>
...@@ -62,7 +63,9 @@ public: ...@@ -62,7 +63,9 @@ public:
QLabel* msg_label; QLabel* msg_label;
QLabel* cmd_prompt; QLabel* cmd_prompt;
QAction* grid_on_w; QAction* grid_on_w;
QAction* grid_sizes[4]; QComboBox* tools_gridsize;
QComboBox* tools_gradient;
QComboBox* tools_textfont;
QAction* show_grid_w; QAction* show_grid_w;
QAction* view_plant_w; QAction* view_plant_w;
QAction* view_graphlist_w; QAction* view_graphlist_w;
...@@ -217,17 +220,18 @@ public slots: ...@@ -217,17 +220,18 @@ public slots:
void activate_decr_intensity(); void activate_decr_intensity();
void activate_incr_shift(); void activate_incr_shift();
void activate_decr_shift(); void activate_decr_shift();
void activate_gradient(int idx);
void activate_gradient(); void activate_gradient();
void activate_reset_mode(); void activate_reset_mode();
void activate_scale(); void activate_scale();
void activate_scale_double(); void activate_scale_double();
void activate_scale_half(); void activate_scale_half();
void activate_grid(bool set); void activate_grid(bool set);
void activate_linewidth(); void activate_linewidth(int idx);
void activate_linetype(); void activate_linetype(int idx);
void activate_gridsize(); void activate_gridsize(int idx);
void activate_textsize(); void activate_textsize(int idx);
void activate_textfont(); void activate_textfont(int idx);
void activate_textbold(bool set); void activate_textbold(bool set);
void activate_zoom_in(); void activate_zoom_in();
void activate_zoom_out(); void activate_zoom_out();
......
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