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