Changeset View
Changeset View
Standalone View
Standalone View
src/Gui/KSMainWindow.cpp
Show First 20 Lines • Show All 45 Lines • ▼ Show 20 Line(s) | |||||
46 | #include "ExportManager.h" | 46 | #include "ExportManager.h" | ||
47 | #include "SpectacleConfig.h" | 47 | #include "SpectacleConfig.h" | ||
48 | 48 | | |||
49 | KSMainWindow::KSMainWindow(bool onClickAvailable, QWidget *parent) : | 49 | KSMainWindow::KSMainWindow(bool onClickAvailable, QWidget *parent) : | ||
50 | QDialog(parent), | 50 | QDialog(parent), | ||
51 | mKSWidget(new KSWidget), | 51 | mKSWidget(new KSWidget), | ||
52 | mDivider(new QFrame), | 52 | mDivider(new QFrame), | ||
53 | mDialogButtonBox(new QDialogButtonBox), | 53 | mDialogButtonBox(new QDialogButtonBox), | ||
54 | mSendToButton(new QPushButton), | | |||
55 | mConfigureButton(new QToolButton), | 54 | mConfigureButton(new QToolButton), | ||
55 | mToolsButton(new QPushButton), | ||||
56 | mSendToButton(new QPushButton), | ||||
56 | mClipboardButton(new QToolButton), | 57 | mClipboardButton(new QToolButton), | ||
57 | mSaveButton(new QToolButton), | 58 | mSaveButton(new QToolButton), | ||
58 | mSaveMenu(new QMenu), | 59 | mSaveMenu(new QMenu), | ||
59 | mMessageWidget(new KMessageWidget), | 60 | mMessageWidget(new KMessageWidget), | ||
61 | mToolsMenu(new QMenu), | ||||
60 | mExportMenu(new ExportMenu(this)), | 62 | mExportMenu(new ExportMenu(this)), | ||
61 | mOnClickAvailable(onClickAvailable) | 63 | mOnClickAvailable(onClickAvailable) | ||
62 | { | 64 | { | ||
63 | // before we do anything, we need to set a window property | 65 | // before we do anything, we need to set a window property | ||
64 | // that skips the close/hide window animation on kwin. this | 66 | // that skips the close/hide window animation on kwin. this | ||
65 | // fixes a ghost image of the spectacle window that appears | 67 | // fixes a ghost image of the spectacle window that appears | ||
66 | // on subsequent screenshots taken with the take new screenshot | 68 | // on subsequent screenshots taken with the take new screenshot | ||
67 | // button | 69 | // button | ||
▲ Show 20 Lines • Show All 59 Lines • ▼ Show 20 Line(s) | 108 | { | |||
127 | mDialogButtonBox->setStandardButtons(QDialogButtonBox::Help); | 129 | mDialogButtonBox->setStandardButtons(QDialogButtonBox::Help); | ||
128 | 130 | | |||
129 | mConfigureButton->setDefaultAction(KStandardAction::preferences(this, SLOT(showPreferencesDialog()), this)); | 131 | mConfigureButton->setDefaultAction(KStandardAction::preferences(this, SLOT(showPreferencesDialog()), this)); | ||
130 | mConfigureButton->setText(i18n("Configure...")); | 132 | mConfigureButton->setText(i18n("Configure...")); | ||
131 | mConfigureButton->setToolTip(i18n("Change Spectacle's settings.")); | 133 | mConfigureButton->setToolTip(i18n("Change Spectacle's settings.")); | ||
132 | mConfigureButton->setToolButtonStyle(Qt::ToolButtonTextBesideIcon); | 134 | mConfigureButton->setToolButtonStyle(Qt::ToolButtonTextBesideIcon); | ||
133 | mDialogButtonBox->addButton(mConfigureButton, QDialogButtonBox::ResetRole); | 135 | mDialogButtonBox->addButton(mConfigureButton, QDialogButtonBox::ResetRole); | ||
134 | 136 | | |||
135 | KGuiItem::assign(mSendToButton, KGuiItem(i18n("Export Image..."))); | 137 | KGuiItem::assign(mToolsButton, KGuiItem(i18n("Tools"))); | ||
138 | mToolsButton->setIcon(QIcon::fromTheme(QStringLiteral("application-menu"))); | ||||
ngraham: This ends up being a generic Hamburger icon. Any chance we could some up with something a bit… | |||||
I actually looked for exactly that for quite a while before submitting and could not find it. But maybe I missed it? Let me know of any suggestions. This one was the best I could find, and it is used in other places too (Systemsettings, Dolphin). rkflx: I actually looked for exactly that for quite a while before submitting and could not find it. | |||||
139 | mDialogButtonBox->addButton(mToolsButton, QDialogButtonBox::ActionRole); | ||||
140 | mToolsMenu->addAction(KStandardAction::print(this, SLOT(showPrintDialog()), this)); | ||||
141 | mToolsButton->setMenu(mToolsMenu); | ||||
142 | | ||||
143 | KGuiItem::assign(mSendToButton, KGuiItem(i18n("Export"))); | ||||
136 | mSendToButton->setIcon(QIcon::fromTheme(QStringLiteral("document-share"))); | 144 | mSendToButton->setIcon(QIcon::fromTheme(QStringLiteral("document-share"))); | ||
137 | mDialogButtonBox->addButton(mSendToButton, QDialogButtonBox::ActionRole); | 145 | mDialogButtonBox->addButton(mSendToButton, QDialogButtonBox::ActionRole); | ||
138 | 146 | | |||
139 | mClipboardButton->setDefaultAction(KStandardAction::copy(this, SLOT(sendToClipboard()), this)); | 147 | mClipboardButton->setDefaultAction(KStandardAction::copy(this, SLOT(sendToClipboard()), this)); | ||
140 | mClipboardButton->setText(i18n("Copy To Clipboard")); | 148 | mClipboardButton->setText(i18n("Copy To Clipboard")); | ||
141 | mClipboardButton->setToolTip(i18n("Copy the current screenshot image to the clipboard.")); | 149 | mClipboardButton->setToolTip(i18n("Copy the current screenshot image to the clipboard.")); | ||
142 | mClipboardButton->setToolButtonStyle(Qt::ToolButtonTextBesideIcon); | 150 | mClipboardButton->setToolButtonStyle(Qt::ToolButtonTextBesideIcon); | ||
143 | mDialogButtonBox->addButton(mClipboardButton, QDialogButtonBox::ActionRole); | 151 | mDialogButtonBox->addButton(mClipboardButton, QDialogButtonBox::ActionRole); | ||
▲ Show 20 Lines • Show All 71 Lines • ▼ Show 20 Line(s) | 220 | case 1: | |||
215 | mSaveMenu->addAction(actionSaveAs); | 223 | mSaveMenu->addAction(actionSaveAs); | ||
216 | break; | 224 | break; | ||
217 | case 2: | 225 | case 2: | ||
218 | mSaveButton->setDefaultAction(actionSaveExit); | 226 | mSaveButton->setDefaultAction(actionSaveExit); | ||
219 | mSaveMenu->addAction(actionSave); | 227 | mSaveMenu->addAction(actionSave); | ||
220 | mSaveMenu->addAction(actionSaveAs); | 228 | mSaveMenu->addAction(actionSaveAs); | ||
221 | break; | 229 | break; | ||
222 | } | 230 | } | ||
223 | | ||||
224 | // finish off building the menu | | |||
225 | mSaveMenu->addAction(KStandardAction::print(this, SLOT(showPrintDialog()), this)); | | |||
226 | } | 231 | } | ||
227 | 232 | | |||
228 | // overrides | 233 | // overrides | ||
229 | 234 | | |||
230 | void KSMainWindow::moveEvent(QMoveEvent *event) | 235 | void KSMainWindow::moveEvent(QMoveEvent *event) | ||
231 | { | 236 | { | ||
232 | Q_UNUSED(event); | 237 | Q_UNUSED(event); | ||
233 | 238 | | |||
▲ Show 20 Lines • Show All 101 Lines • Show Last 20 Lines |
This ends up being a generic Hamburger icon. Any chance we could some up with something a bit more meaningful? Maybe a wrench or gear icon that would go with "Tools" better?