Icons for shortcuts.
This commit is contained in:
parent
431b668f28
commit
82514c1239
1
src/core/defs.h.in
Normal file → Executable file
1
src/core/defs.h.in
Normal file → Executable file
@ -26,6 +26,7 @@
|
|||||||
|
|
||||||
#define TEXT_TITLE_LIMIT 30
|
#define TEXT_TITLE_LIMIT 30
|
||||||
#define MAX_ZOOM_FACTOR 10.0
|
#define MAX_ZOOM_FACTOR 10.0
|
||||||
|
#define ICON_SIZE_SETTINGS 16
|
||||||
#define DATABASE_DRIVER "QSQLITE"
|
#define DATABASE_DRIVER "QSQLITE"
|
||||||
|
|
||||||
#define APP_DB_INIT_FILE "db_init.sql"
|
#define APP_DB_INIT_FILE "db_init.sql"
|
||||||
|
19
src/gui/dynamicshortcutswidget.cpp
Normal file → Executable file
19
src/gui/dynamicshortcutswidget.cpp
Normal file → Executable file
@ -3,6 +3,7 @@
|
|||||||
#include <QLabel>
|
#include <QLabel>
|
||||||
#include <QSpacerItem>
|
#include <QSpacerItem>
|
||||||
|
|
||||||
|
#include "core/defs.h"
|
||||||
#include "gui/dynamicshortcutswidget.h"
|
#include "gui/dynamicshortcutswidget.h"
|
||||||
#include "gui/shortcutcatcher.h"
|
#include "gui/shortcutcatcher.h"
|
||||||
|
|
||||||
@ -63,17 +64,23 @@ void DynamicShortcutsWidget::populate(const QList<QAction *> actions) {
|
|||||||
m_actionBindings << new_binding;
|
m_actionBindings << new_binding;
|
||||||
|
|
||||||
// Add new catcher to our control.
|
// Add new catcher to our control.
|
||||||
QLabel *label = new QLabel(this);
|
QLabel *action_label = new QLabel(this);
|
||||||
label->setText(action->text().remove('&'));
|
action_label->setText(action->text().remove('&'));
|
||||||
label->setSizePolicy(QSizePolicy::Minimum, QSizePolicy::Preferred);
|
action_label->setToolTip(action->toolTip());
|
||||||
|
action_label->setSizePolicy(QSizePolicy::Minimum, QSizePolicy::Preferred);
|
||||||
|
|
||||||
m_layout->addWidget(label, row_id, 0);
|
QLabel *action_icon = new QLabel(this);
|
||||||
m_layout->addWidget(catcher, row_id, 1);
|
action_icon->setPixmap(action->icon().pixmap(ICON_SIZE_SETTINGS, ICON_SIZE_SETTINGS));
|
||||||
|
action_icon->setToolTip(action->toolTip());
|
||||||
|
|
||||||
|
m_layout->addWidget(action_icon, row_id, 0);
|
||||||
|
m_layout->addWidget(action_label, row_id, 1);
|
||||||
|
m_layout->addWidget(catcher, row_id, 2);
|
||||||
|
|
||||||
row_id++;
|
row_id++;
|
||||||
}
|
}
|
||||||
|
|
||||||
// Make sure that "spacer" is added.
|
// Make sure that "spacer" is added.
|
||||||
m_layout->setRowStretch(row_id, 1);
|
m_layout->setRowStretch(row_id, 1);
|
||||||
m_layout->setColumnStretch(0, 1);
|
m_layout->setColumnStretch(1, 1);
|
||||||
}
|
}
|
||||||
|
Loading…
x
Reference in New Issue
Block a user