Minor UI improvements for Windows
rodzic
4155acfde7
commit
3c46483bcb
|
@ -121,6 +121,7 @@ void BitmapPreview::paintEvent(QPaintEvent *pe)
|
||||||
_converter->paintOverlay(op, _overlayMode, _image);
|
_converter->paintOverlay(op, _overlayMode, _image);
|
||||||
}
|
}
|
||||||
} else {
|
} else {
|
||||||
|
p.setPen(Qt::white);
|
||||||
p.drawText(QRect(0, 0, width(), height()), Qt::AlignCenter, tr("No Bitmap Loaded"));
|
p.drawText(QRect(0, 0, width(), height()), Qt::AlignCenter, tr("No Bitmap Loaded"));
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
|
@ -37,6 +37,7 @@
|
||||||
#include <QtWidgets/QPlainTextEdit>
|
#include <QtWidgets/QPlainTextEdit>
|
||||||
#include <QtWidgets/QScrollArea>
|
#include <QtWidgets/QScrollArea>
|
||||||
#include <QtWidgets/QSplitter>
|
#include <QtWidgets/QSplitter>
|
||||||
|
#include <QtGui/QDesktopServices>
|
||||||
|
|
||||||
|
|
||||||
MainWindow::MainWindow(QWidget *parent)
|
MainWindow::MainWindow(QWidget *parent)
|
||||||
|
@ -65,7 +66,7 @@ void MainWindow::initializeConverterList()
|
||||||
void MainWindow::initializeUi()
|
void MainWindow::initializeUi()
|
||||||
{
|
{
|
||||||
setMinimumSize(800, 600);
|
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();
|
auto centralWidget = new QWidget();
|
||||||
centralWidget->setObjectName("CentralWidget");
|
centralWidget->setObjectName("CentralWidget");
|
||||||
|
@ -179,12 +180,41 @@ void MainWindow::initializeMenu()
|
||||||
qApp->quit();
|
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 menuHelp = menuBar()->addMenu(tr("Help"));
|
||||||
auto actionAbout = menuHelp->addAction(tr("About..."));
|
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, [=]{
|
connect(actionAbout, &QAction::triggered, [=]{
|
||||||
QMessageBox::about(this, tr("Micropython Bitmap Tool by Lucky Resistor"),
|
QMessageBox::about(this, tr("Micropython Bitmap Tool by Lucky Resistor"),
|
||||||
tr("<h1>Micropython Bitmap Tool</h1><p>(c)2021 by Lucky Resistor</p>"
|
tr("<h1>Micropython Bitmap Tool</h1>"
|
||||||
"<p><b>Version %1</b></p>").arg(qApp->applicationVersion()));
|
"<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..."));
|
auto actionAboutQt = menuHelp->addAction(tr("Information About Qt..."));
|
||||||
connect(actionAboutQt, &QAction::triggered, [=]{
|
connect(actionAboutQt, &QAction::triggered, [=]{
|
||||||
|
|
|
@ -6,9 +6,14 @@
|
||||||
|
|
||||||
#SettingsPanel {
|
#SettingsPanel {
|
||||||
background-color: #616875;
|
background-color: #616875;
|
||||||
|
color: #f8f8f8;
|
||||||
padding: 16px;
|
padding: 16px;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
#SettingsPanel QLabel {
|
||||||
|
color: #f8f8f8;
|
||||||
|
}
|
||||||
|
|
||||||
#BitmapInfo {
|
#BitmapInfo {
|
||||||
border: 1px solid rgba(0,0,0,0.25);
|
border: 1px solid rgba(0,0,0,0.25);
|
||||||
padding: 8px;
|
padding: 8px;
|
||||||
|
|
2
main.cpp
2
main.cpp
|
@ -23,7 +23,7 @@ int main(int argc, char *argv[])
|
||||||
{
|
{
|
||||||
QApplication a(argc, argv);
|
QApplication a(argc, argv);
|
||||||
a.setApplicationName("MicroPython Bitmap Tool");
|
a.setApplicationName("MicroPython Bitmap Tool");
|
||||||
a.setApplicationVersion("1.0");
|
a.setApplicationVersion("1.0.1");
|
||||||
a.setApplicationDisplayName("MicroPython Bitmap Tool");
|
a.setApplicationDisplayName("MicroPython Bitmap Tool");
|
||||||
a.setOrganizationDomain("luckyresistor.me");
|
a.setOrganizationDomain("luckyresistor.me");
|
||||||
a.setOrganizationName("Lucky Resistoor");
|
a.setOrganizationName("Lucky Resistoor");
|
||||||
|
|
Ładowanie…
Reference in New Issue