Minor UI improvements for Windows

main
Lucky Resistor 2021-03-10 17:37:51 +01:00
rodzic 4155acfde7
commit 3c46483bcb
5 zmienionych plików z 41 dodań i 5 usunięć

Wyświetl plik

@ -121,6 +121,7 @@ void BitmapPreview::paintEvent(QPaintEvent *pe)
_converter->paintOverlay(op, _overlayMode, _image);
}
} else {
p.setPen(Qt::white);
p.drawText(QRect(0, 0, width(), height()), Qt::AlignCenter, tr("No Bitmap Loaded"));
}
}

Wyświetl plik

@ -37,6 +37,7 @@
#include <QtWidgets/QPlainTextEdit>
#include <QtWidgets/QScrollArea>
#include <QtWidgets/QSplitter>
#include <QtGui/QDesktopServices>
MainWindow::MainWindow(QWidget *parent)
@ -65,7 +66,7 @@ void MainWindow::initializeConverterList()
void MainWindow::initializeUi()
{
setMinimumSize(800, 600);
setWindowTitle(tr("Micropython Bitmap Tool by Lucky Resistor"));
setWindowTitle(tr("Micropython Bitmap Tool - V%1 - Lucky Resistor").arg(qApp->applicationVersion()));
auto centralWidget = new QWidget();
centralWidget->setObjectName("CentralWidget");
@ -179,12 +180,41 @@ void MainWindow::initializeMenu()
qApp->quit();
});
auto menuEdit = menuBar()->addMenu(tr("Edit"));
menuEdit->addAction(tr("Cut"), [=]{
QMetaObject::invokeMethod(focusWidget(), "cut");
}, QKeySequence("Ctrl+X"));
menuEdit->addAction(tr("Copy"), [=]{
QMetaObject::invokeMethod(focusWidget(), "copy");
}, QKeySequence("Ctrl+C"));
menuEdit->addAction(tr("Paste"), [=]{
QMetaObject::invokeMethod(focusWidget(), "paste");
}, QKeySequence("Ctrl+V"));
auto menuHelp = menuBar()->addMenu(tr("Help"));
auto actionAbout = menuHelp->addAction(tr("About..."));
menuHelp->addAction(tr("Lucky Resistor..."), []{
QDesktopServices::openUrl(QUrl("https://luckyresistor.me/"));
});
menuHelp->addAction(tr("Project Page..."), []{
QDesktopServices::openUrl(QUrl("https://luckyresistor.me/applications/micropython-bitmap-tool/"));
});
connect(actionAbout, &QAction::triggered, [=]{
QMessageBox::about(this, tr("Micropython Bitmap Tool by Lucky Resistor"),
tr("<h1>Micropython Bitmap Tool</h1><p>(c)2021 by Lucky Resistor</p>"
"<p><b>Version %1</b></p>").arg(qApp->applicationVersion()));
tr("<h1>Micropython Bitmap Tool</h1>"
"<p>Copyright (c)2021 by Lucky Resistor</p>"
"<p><b>Version %1</b></p>"
"<h2>License</h2>"
"<p>This program is free software: you can redistribute it and/or modify "
"it under the terms of the GNU General Public License as published by "
"the Free Software Foundation, either version 3 of the License, or "
"(at your option) any later version.</p>"
"<p>This program is distributed in the hope that it will be useful, "
"but WITHOUT ANY WARRANTY; without even the implied warranty of "
"MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the "
"GNU General Public License for more details. </p>"
"You should have received a copy of the GNU General Public License "
"along with this program. If not, see https://www.gnu.org/licenses/.</p>").arg(qApp->applicationVersion()));
});
auto actionAboutQt = menuHelp->addAction(tr("Information About Qt..."));
connect(actionAboutQt, &QAction::triggered, [=]{

Wyświetl plik

@ -4,7 +4,7 @@ greaterThan(QT_MAJOR_VERSION, 4): QT += widgets
CONFIG += c++17
TARGET = "MicroPython Bitmap Tool"
TARGET = "MicroPythonBitmapTool"
# You can make your code fail to compile if it uses deprecated APIs.
# In order to do so, uncomment the following line.

Wyświetl plik

@ -6,9 +6,14 @@
#SettingsPanel {
background-color: #616875;
color: #f8f8f8;
padding: 16px;
}
#SettingsPanel QLabel {
color: #f8f8f8;
}
#BitmapInfo {
border: 1px solid rgba(0,0,0,0.25);
padding: 8px;

Wyświetl plik

@ -23,7 +23,7 @@ int main(int argc, char *argv[])
{
QApplication a(argc, argv);
a.setApplicationName("MicroPython Bitmap Tool");
a.setApplicationVersion("1.0");
a.setApplicationVersion("1.0.1");
a.setApplicationDisplayName("MicroPython Bitmap Tool");
a.setOrganizationDomain("luckyresistor.me");
a.setOrganizationName("Lucky Resistoor");