Skip to content

Commit

Permalink
Add internal Dark and Light styles.
Browse files Browse the repository at this point in the history
  • Loading branch information
epasveer committed Feb 24, 2024
1 parent 3e3444c commit abfa49c
Show file tree
Hide file tree
Showing 431 changed files with 5,060 additions and 7 deletions.
1 change: 1 addition & 0 deletions CHANGELOG.md
Original file line number Diff line number Diff line change
Expand Up @@ -12,6 +12,7 @@
The 100 limit probably needs to be configurable.
* Added register profiles to show only interesting/relevant registers.
* Added UTF-8,16,32 support in the Memory Visualizer.
* Added an internal "dark" and "light" theme via the View->Style menu.

## [2.3] - 2023-11-19
* In the margins of the source windows, allow CTRL+DoubleClick to do a quick RunToLine or RunToAddress.
Expand Down
38 changes: 38 additions & 0 deletions debian/copyright
Original file line number Diff line number Diff line change
Expand Up @@ -52,6 +52,22 @@ Copyright:
<https://thenounproject.com/tolicon/> Toli
License: CC-BY-3.0

Files:
src/resources/qdarkstyle/dark/darkstyle.qrc
src/resources/qdarkstyle/dark/darkstyle.qss
src/resources/qdarkstyle/light/lightstyle.qrc
src/resources/qdarkstyle/light/lightstyle.qss
Copyright:
Copyright (c) 2013-2019 Colin Duquesnoy
License: The MIT License (MIT)

Files:
src/resources/qdarkstyle/dark/rc/*
src/resources/qdarkstyle/light/rc/*
Copyright:
Copyright (c) 2013-2019 Colin Duquesnoy
License: CC-BY-4.0

License: GPL-3.0+
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
Expand Down Expand Up @@ -694,3 +710,25 @@ License: CC-BY-4.0
that apply to the Licensor or You, including from the legal
processes of any jurisdiction or authority.

License: The MIT License (MIT)

https://opensource.org/license/MIT

Permission is hereby granted, free of charge, to any person obtaining
a copy of this software and associated documentation files (the “Software”),
to deal in the Software without restriction, including without limitation
the rights to use, copy, modify, merge, publish, distribute, sublicense,
and/or sell copies of the Software, and to permit persons to whom the
Software is furnished to do so, subject to the following conditions:

The above copyright notice and this permission notice shall be included
in all copies or substantial portions of the Software.

THE SOFTWARE IS PROVIDED “AS IS”, WITHOUT WARRANTY OF ANY KIND, EXPRESS
OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL
THE AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,
OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN
THE SOFTWARE.

4 changes: 2 additions & 2 deletions src/CMakeLists.txt
Original file line number Diff line number Diff line change
Expand Up @@ -237,9 +237,9 @@ set(SOURCE_FILES
)

if(${QTVERSION} STREQUAL "QT6")
qt6_add_resources(SOURCE_FILES resource.qrc)
qt6_add_resources(SOURCE_FILES resource.qrc resources/qdarkstyle/dark/darkstyle.qrc resources/qdarkstyle/light/lightstyle.qrc)
elseif(${QTVERSION} STREQUAL "QT5")
qt5_add_resources(SOURCE_FILES resource.qrc)
qt5_add_resources(SOURCE_FILES resource.qrc resources/qdarkstyle/dark/darkstyle.qrc resources/qdarkstyle/light/lightstyle.qrc)
endif()

# Set non-Debug build as GUI application.
Expand Down
45 changes: 41 additions & 4 deletions src/SeerMainWindow.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -58,6 +58,14 @@ SeerMainWindow::SeerMainWindow(QWidget* parent) : QMainWindow(parent) {
_styleMenuActionGroup->setEnabled(true);
_styleMenuActionGroup->setVisible(true);

QAction* lightStyleAction = menuStyles->addAction("light");
lightStyleAction->setCheckable(true);
_styleMenuActionGroup->addAction(lightStyleAction);

QAction* darkStyleAction = menuStyles->addAction("dark");
darkStyleAction->setCheckable(true);
_styleMenuActionGroup->addAction(darkStyleAction);

QStringList styles = QStyleFactory::keys();

for (int i = 0; i < styles.size(); i++) {
Expand Down Expand Up @@ -467,6 +475,36 @@ const QString& SeerMainWindow::executableBreakMode () const {
return gdbWidget->executableBreakMode();
}

void SeerMainWindow::setStyleName (const QString& name) {

// Check for Dark/Light style from Seer's resource tree.
if (name == "dark" || name == "light") {

QFile s(":qdarkstyle/" + name + "/" + name + "style.qss");
if (s.exists() == false) {
qDebug() << "Stylesheet '" + name + "' doesn't exist!";
return;
}

s.open(QFile::ReadOnly | QFile::Text);
QTextStream ts(&s);
qApp->setStyleSheet(ts.readAll());

_styleName = name;

// Otherwise, a system installed one or Qt internal one.
}else{

QApplication::setStyle(name);

_styleName = name;
}
}

const QString& SeerMainWindow::styleName () {
return _styleName;
}

void SeerMainWindow::handleFileDebug () {

SeerDebugDialog dlg(this);
Expand Down Expand Up @@ -779,7 +817,7 @@ void SeerMainWindow::handleStyleMenuChanged () {
return;
}

QApplication::setStyle(action->text());
setStyleName(action->text());
}

void SeerMainWindow::handleShowMessage (QString message, int time) {
Expand Down Expand Up @@ -1218,8 +1256,7 @@ void SeerMainWindow::writeConfigSettings () {
QSettings settings;

settings.beginGroup("mainwindow"); {
QStyle* currentStyle = QApplication::style();
settings.setValue("qtstyle", currentStyle->objectName());
settings.setValue("qtstyle", styleName());
} settings.endGroup();

settings.beginGroup("gdb"); {
Expand Down Expand Up @@ -1299,7 +1336,7 @@ void SeerMainWindow::readConfigSettings () {

settings.beginGroup("mainwindow"); {
if (settings.contains("qtstyle")) {
QApplication::setStyle(settings.value("qtstyle").toString());
setStyleName(settings.value("qtstyle").toString());
}
} settings.endGroup();

Expand Down
4 changes: 4 additions & 0 deletions src/SeerMainWindow.h
Original file line number Diff line number Diff line change
Expand Up @@ -64,6 +64,9 @@ class SeerMainWindow : public QMainWindow, protected Ui::SeerMainWindowForm {
const QString& executableLaunchMode () const;
const QString& executableBreakMode () const;

void setStyleName (const QString& name);
const QString& styleName ();

private slots:
void handleFileDebug ();
void handleFileArguments ();
Expand Down Expand Up @@ -104,6 +107,7 @@ class SeerMainWindow : public QMainWindow, protected Ui::SeerMainWindowForm {

private:
QActionGroup* _styleMenuActionGroup;
QString _styleName;
QAction* _interruptAction;
SeerProgressIndicator* _progressIndicator;
SeerKeySettings _keySettings;
Expand Down
83 changes: 83 additions & 0 deletions src/resource_qdarkstylesheet.qrc
Original file line number Diff line number Diff line change
@@ -0,0 +1,83 @@
<RCC>
<qresource prefix="/seer">
<file>resources/seergdb_32x32.png</file>
<file>resources/seergdb_64x64.png</file>
<file>resources/seergdb_128x128.png</file>
<file>resources/seergdb_256x256.png</file>
<file>resources/seergdb_512x512.png</file>
<file>resources/rr_256x256.png</file>
<file>resources/ABOUT.md</file>
<file>resources/thenounproject/memory.svg</file>
<file>resources/thenounproject/source.svg</file>
<file>resources/thenounproject/assembly.svg</file>
<file>resources/thenounproject/keyboard.svg</file>
<file>resources/thenounproject/configure.svg</file>
<file>resources/thenounproject/stop.svg</file>
<file>resources/thenounproject/fortune-teller.svg</file>
<file>resources/icons-icons/gdb.png</file>
<file>resources/icons-icons/editor.png</file>
<file>resources/icons-icons/font.png</file>
<file>resources/icons-icons/arguments.png</file>
<file>resources/icons-icons/debug.png</file>
<file>resources/icons-icons/exit.png</file>
<file>resources/icons-icons/console.png</file>
<file>resources/icons-icons/hide.png</file>
<file>resources/icons-icons/maximize.png</file>
<file>resources/icons-icons/minimize.png</file>
<file>resources/icons-icons/style.png</file>
<file>resources/RelaxLightIcons/application-menu.svg</file>
<file>resources/RelaxLightIcons/document-new.svg</file>
<file>resources/RelaxLightIcons/document-open.svg</file>
<file>resources/RelaxLightIcons/document-print.svg</file>
<file>resources/RelaxLightIcons/document-save-as.svg</file>
<file>resources/RelaxLightIcons/document-save.svg</file>
<file>resources/RelaxLightIcons/edit-clear.svg</file>
<file>resources/RelaxLightIcons/edit-delete.svg</file>
<file>resources/RelaxLightIcons/edit-find.svg</file>
<file>resources/RelaxLightIcons/go-down.svg</file>
<file>resources/RelaxLightIcons/go-up.svg</file>
<file>resources/RelaxLightIcons/go-next.svg</file>
<file>resources/RelaxLightIcons/go-previous.svg</file>
<file>resources/RelaxLightIcons/list-add.svg</file>
<file>resources/RelaxLightIcons/list-remove.svg</file>
<file>resources/RelaxLightIcons/view-refresh.svg</file>
<file>resources/RelaxLightIcons/debug-execute-from-cursor.svg</file>
<file>resources/RelaxLightIcons/debug-execute-to-cursor.svg</file>
<file>resources/RelaxLightIcons/debug-run-cursor.svg</file>
<file>resources/RelaxLightIcons/debug-run.svg</file>
<file>resources/RelaxLightIcons/debug-step-instruction.svg</file>
<file>resources/RelaxLightIcons/debug-step-into-instruction.svg</file>
<file>resources/RelaxLightIcons/debug-step-into.svg</file>
<file>resources/RelaxLightIcons/debug-step-out.svg</file>
<file>resources/RelaxLightIcons/debug-step-over.svg</file>
<file>resources/RelaxLightIcons/help-about.svg</file>
<file>resources/RelaxLightIcons/help-whatsthis.svg</file>
<file>resources/RelaxLightIcons/tools-media-optical-burn-image.svg</file>
<file>resources/RelaxLightIcons/data-error.svg</file>
<file>resources/RelaxLightIcons/data-information.svg</file>
<file>resources/RelaxLightIcons/data-warning.svg</file>
<file>resources/RelaxLightIcons/dialog-question.svg</file>
<file>resources/qdarkstyle/light/lightstyle.qrc</file>
<file>resources/qdarkstyle/dark/darkstyle.qrc</file>
<file>resources/help/ThreadProcessInfoBrowser.md</file>
<file>resources/help/seergdb.hlp</file>
<file>resources/help/StructVisualizer.md</file>
<file>resources/help/BasicStructVisualizer.md</file>
<file>resources/help/MemoryVisualizer.md</file>
<file>resources/help/ArrayVisualizer.md</file>
<file>resources/help/ImageVisualizer.md</file>
<file>resources/help/StackInfoBrowser.md</file>
<file>resources/help/VariableRegisterInfoBrowser.md</file>
<file>resources/help/SourceSymbolLibraryInfoBrowser.md</file>
<file>resources/help/CodeManager.md</file>
<file>resources/help/BreakpointGdbSeerManager.md</file>
<file>resources/help/MainWindow.md</file>
<file>resources/help/DebugModes.md</file>
<file>resources/help/RunDebugMode.md</file>
<file>resources/help/AttachDebugMode.md</file>
<file>resources/help/ConnectDebugMode.md</file>
<file>resources/help/RRDebugMode.md</file>
<file>resources/help/CorefileDebugMode.md</file>
</qresource>
</RCC>

8 changes: 8 additions & 0 deletions src/resources/ABOUT.md
Original file line number Diff line number Diff line change
Expand Up @@ -39,6 +39,14 @@ The main Seer icon and other icons.
|Icon <a href="https://thenounproject.com/icon/cpp-file-252779/" title="">source.svg</a> | Created by <a href="https://thenounproject.com/kozinn/" title="">kozinn</a> | (License <a href="https://creativecommons.org/licenses/by/3.0/legalcode" title="">CC3.0)</a> |
|Icon <a href="https://thenounproject.com/icon/interruption-4417639/" title="">stop.sgv</a> | Created by <a href="https://thenounproject.com/andre.buand10/" title="">andre.buand10</a> | (License <a href="https://creativecommons.org/licenses/by/3.0/legalcode" title="">CC3.0)</a> |

&nbsp;
&nbsp;

| Styles/Themes | Creator | License |
| -------------------------------------------------------------------------------------------------------------------------------------- | --------------------------------------------------------------------------------------------------------------------------- | --------------------------------------------------------------------------------------------- |
|Style <a href="https://github.com/ColinDuquesnoy/QDarkStyleSheet" title="">QDarkStyleSheet</a> | Created by <a href="https://github.com/ColinDuquesnoy" title="">Colin Duquesnoy</a> | (License <a href="https://opensource.org/license/MIT" title="">MIT)</a> |
| | | (License <a href="https://creativecommons.org/licenses/by/4.0/legalcode" title="">CC4.0)</a> |

&nbsp;
&nbsp;

Expand Down
16 changes: 16 additions & 0 deletions src/resources/qdarkstyle/ABOUT.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,16 @@

Seer uses the QDarkStyle style sheets to provide a "dark" theme. Inversely, Seer uses the "light" theme as well.

The QDarkStyle project is here:

https://github.com/ColinDuquesnoy/QDarkStyleSheet

And its license is here:

QDarkStyleSheet is released under the MIT license and its icons are released under the CC4.0 license.

https://github.com/ColinDuquesnoy/QDarkStyleSheet/blob/master/LICENSE.rst

Copyright (c) 2013-2019 Colin Duquesnoy


Loading

0 comments on commit abfa49c

Please sign in to comment.