addtheme:flatgray.

This commit is contained in:
2025-10-20 15:17:31 +08:00
parent b1f31fc4d0
commit aead962ab3
32 changed files with 750 additions and 28 deletions

View File

@@ -26,6 +26,7 @@ Form/Transform.h Form/Transform.cpp Form/Transform.ui
Control/cusTableWidget.cpp Control/cusTableWidget.h
Control/cpTableWidget.h Control/cpTableWidget.cpp
GuiUtil/Config.h GuiUtil/Config.cpp
../Res/qss.qrc
)
if(${QT_VERSION_MAJOR} GREATER_EQUAL 6)

View File

@@ -3,6 +3,7 @@
#include <QLabel>
#include <QScreen>
#include <QSplitter>
#include <QVBoxLayout>
#include <fversion.h>
#include "./ui_frelayGUI.h"
@@ -10,7 +11,7 @@
static LogPrint* logPrint = nullptr;
frelayGUI::frelayGUI(QWidget* parent) : QMainWindow(parent), ui(new Ui::frelayGUI)
frelayGUI::frelayGUI(QWidget* parent) : QDialog(parent), ui(new Ui::frelayGUI)
{
config_ = std::make_shared<FrelayConfig>();
@@ -30,10 +31,10 @@ frelayGUI::frelayGUI(QWidget* parent) : QMainWindow(parent), ui(new Ui::frelayGU
setWindowTitle(QString(tr("frelay %1")).arg(VERSION_NUM));
QLabel* permanent = new QLabel(this);
permanent->setFrameStyle(QFrame::Box | QFrame::Sunken);
permanent->setText(QString("%1 on %2").arg(VERSION_GIT_COMMIT, VERSION_GIT_BRANCH));
this->statusBar()->addPermanentWidget(permanent);
// QLabel* permanent = new QLabel(this);
// permanent->setFrameStyle(QFrame::Box | QFrame::Sunken);
// permanent->setText(QString("%1 on %2").arg(VERSION_GIT_COMMIT, VERSION_GIT_BRANCH));
//this->statusBar()->addPermanentWidget(permanent);
}
frelayGUI::~frelayGUI()
@@ -109,7 +110,10 @@ void frelayGUI::ControlLayout()
sizes << height() * 2 / 5 << height() * 3 / 5;
splitter->setSizes(sizes);
setCentralWidget(splitter);
QVBoxLayout* layout = new QVBoxLayout();
layout->addWidget(splitter);
setLayout(layout);
// setCentralWidget(splitter);
}
void frelayGUI::ControlMsgHander(QtMsgType type, const QMessageLogContext& context, const QString& msg)
@@ -142,5 +146,5 @@ void frelayGUI::HandleTask(const QVector<TransTask>& tasks)
void frelayGUI::closeEvent(QCloseEvent* event)
{
QMainWindow::closeEvent(event);
QDialog::closeEvent(event);
}

View File

@@ -3,7 +3,7 @@
#include <ClientCore.h>
#include <QFile>
#include <QMainWindow>
#include <QDialog>
#include <QTabWidget>
#include "Control/CompareControl.h"
@@ -18,7 +18,7 @@ class frelayGUI;
}
QT_END_NAMESPACE
class frelayGUI : public QMainWindow
class frelayGUI : public QDialog
{
Q_OBJECT

View File

@@ -1,30 +1,18 @@
<?xml version="1.0" encoding="UTF-8"?>
<ui version="4.0">
<class>frelayGUI</class>
<widget class="QMainWindow" name="frelayGUI">
<widget class="QDialog" name="frelayGUI">
<property name="geometry">
<rect>
<x>0</x>
<y>0</y>
<width>800</width>
<height>600</height>
<width>400</width>
<height>300</height>
</rect>
</property>
<property name="windowTitle">
<string>frelayGUI</string>
</property>
<widget class="QWidget" name="centralwidget"/>
<widget class="QMenuBar" name="menubar">
<property name="geometry">
<rect>
<x>0</x>
<y>0</y>
<width>800</width>
<height>25</height>
</rect>
</property>
</widget>
<widget class="QStatusBar" name="statusbar"/>
</widget>
<resources/>
<connections/>

View File

@@ -29,6 +29,11 @@ int main(int argc, char* argv[])
frelayGUI w;
QFile file(":/qss/flatgray.css");
if (file.open(QFile::ReadOnly)) {
a.setStyleSheet(file.readAll());
}
QObject::connect(&a, &SingleApplication::instanceStarted, &w, [&w]() {
w.showNormal();
w.raise();