Add minor visual improvements to the menu widgets

This commit is contained in:
lupoDharkael
2017-08-01 13:21:39 +02:00
parent ebd5272dd9
commit 3daeab9b66
6 changed files with 39 additions and 23 deletions

View File

@@ -39,6 +39,5 @@
<file>img/configBlack/name_edition.png</file>
<file>img/buttonIconsBlack/size_indicator.png</file>
<file>img/buttonIconsWhite/size_indicator.png</file>
<file>img/gplv3.png</file>
</qresource>
</RCC>

Binary file not shown.

Before

Width:  |  Height:  |  Size: 3.4 KiB

View File

@@ -85,7 +85,7 @@ void GeneneralConf::initShowTrayIcon() {
ConfigHandler config;
bool checked = !config.getDisabledTrayIcon();
m_showTray->setChecked(checked);
m_showTray->setToolTip(tr("Show systemtray icons"));
m_showTray->setToolTip(tr("Show the systemtray icon"));
m_layout->addWidget(m_showTray);
connect(m_showTray, &QCheckBox::clicked, this,

View File

@@ -118,6 +118,7 @@ void UIcolorEditor::initButtons() {
h2->addWidget(frame2);
frame2->setFixedSize(frameSize, frameSize);
m_labelContrast = new ClickableLabel(tr("Contrast Color"), this);
m_labelContrast->setStyleSheet("color : gray");
h2->addWidget(m_labelContrast);
m_vLayout->addLayout(h2);

View File

@@ -30,22 +30,14 @@ InfoWindow::InfoWindow(QWidget *parent) : QWidget(parent) {
setWindowIcon(QIcon(":img/flameshot.png"));
setWindowTitle(tr("About"));
layout = new QVBoxLayout(this);
layout->addWidget(new QLabel(tr("<b>Shortcuts</b>"), this));
m_layout = new QVBoxLayout(this);
initLabels();
initInfoTable();
layout->addWidget(new QLabel(tr("<b>License</b>"), this));
auto imgGPL = new QLabel(this);
imgGPL->setStyleSheet("background: white; border-color: black; border-width: 2px");
imgGPL->setPixmap(QPixmap(":img/gplv3.png"));
imgGPL->setFixedWidth(imgGPL->pixmap()->width());
layout->addWidget(imgGPL);
show();
}
QVector<const char *> InfoWindow::keys = {
QVector<const char *> InfoWindow::m_keys = {
"←↓↑→",
"SHIFT + ←↓↑→",
"ESC",
@@ -55,7 +47,7 @@ QVector<const char *> InfoWindow::keys = {
QT_TR_NOOP("Right Click")
};
QVector<const char *> InfoWindow::description = {
QVector<const char *> InfoWindow::m_description = {
QT_TR_NOOP("Move selection 1px"),
QT_TR_NOOP("Resize selection 1px"),
QT_TR_NOOP("Quit capture"),
@@ -70,10 +62,10 @@ void InfoWindow::initInfoTable() {
QTableWidget *table = new QTableWidget(this);
table->setToolTip(tr("Available shorcuts in the screen capture mode."));
layout->addWidget(table);
m_layout->addWidget(table);
table->setColumnCount(2);
table->setRowCount(keys.size());
table->setRowCount(m_keys.size());
table->setSelectionMode(QAbstractItemView::NoSelection);
table->setFocusPolicy(Qt::NoFocus);
table->verticalHeader()->hide();
@@ -82,9 +74,9 @@ void InfoWindow::initInfoTable() {
names << tr("Key") << tr("Description");
table->setHorizontalHeaderLabels(names);
//add content
for (int i= 0; i < keys.size(); ++i){
table->setItem(i, 0, new QTableWidgetItem(tr(keys.at(i))));
table->setItem(i, 1, new QTableWidgetItem(tr(description.at(i))));
for (int i= 0; i < m_keys.size(); ++i){
table->setItem(i, 0, new QTableWidgetItem(tr(m_keys.at(i))));
table->setItem(i, 1, new QTableWidgetItem(tr(m_description.at(i))));
}
// adjust size
table->resizeColumnsToContents();
@@ -96,6 +88,29 @@ void InfoWindow::initInfoTable() {
QSizePolicy::Expanding);
}
void InfoWindow::initLabels() {
m_layout->addStretch();
QLabel *licenseTitleLabel = new QLabel(tr("<b>License</b>"), this);
licenseTitleLabel->setAlignment(Qt::AlignHCenter);
m_layout->addWidget(licenseTitleLabel);
QLabel *licenseLabel = new QLabel("GPLv3+", this);
licenseLabel->setAlignment(Qt::AlignHCenter);
m_layout->addWidget(licenseLabel);
m_layout->addStretch();
QLabel *versionTitleLabel = new QLabel(tr("<b>Version</b>"), this);
versionTitleLabel->setAlignment(Qt::AlignHCenter);
m_layout->addWidget(versionTitleLabel);
QLabel *versionLabel = new QLabel(APP_VERSION, this);
versionLabel->setAlignment(Qt::AlignHCenter);
m_layout->addWidget(versionLabel);
m_layout->addStretch();
m_layout->addSpacing(10);
QLabel *shortcutsTitleLabel = new QLabel(tr("<b>Shortcuts</b>"), this);
shortcutsTitleLabel->setAlignment(Qt::AlignHCenter);;
m_layout->addWidget(shortcutsTitleLabel);
}
void InfoWindow::keyPressEvent(QKeyEvent *e) {
if (e->key() == Qt::Key_Escape) {
close();

View File

@@ -31,11 +31,12 @@ protected:
void keyPressEvent(QKeyEvent *);
private:
void initInfoTable();
QVBoxLayout *layout;
inline void initInfoTable();
inline void initLabels();
QVBoxLayout *m_layout;
static QVector<const char *> keys;
static QVector<const char *> description;
static QVector<const char *> m_keys;
static QVector<const char *> m_description;
};
#endif // INFOWINDOW_H