First steps.
@@ -43,23 +43,25 @@ BCThemeSwitchButton::BCThemeSwitchButton(QWidget *parent )
|
||||
|
||||
// CSS: Transparent, damit es sich nahtlos in den StatusBar einfügt
|
||||
// Schriftgröße etwas erhöhen, damit die Emojis gut erkennbar sind
|
||||
/*
|
||||
|
||||
setStyleSheet(R"(
|
||||
QPushButton {
|
||||
BCThemeSwitchButton
|
||||
{
|
||||
border: none;
|
||||
background-color: transparent;
|
||||
background-color: green;
|
||||
font-size: 11pt;
|
||||
}
|
||||
QPushButton:hover {
|
||||
background-color: rgba(128, 128, 128, 30); // Leichter Hover-Effekt
|
||||
BCThemeSwitchButton:Hover
|
||||
{
|
||||
background-color: rgba(128, 128, 128, 30);
|
||||
border-radius: 24px;
|
||||
}
|
||||
)");
|
||||
*/
|
||||
|
||||
// Initialer Status (Startet im Dark Mode -> zeigt Mond)
|
||||
updateIcon();
|
||||
|
||||
connect(this, &QPushButton::clicked, this, &BCThemeSwitchButton::toggle);
|
||||
connect(this, &QPushButton::clicked, this, &BCThemeSwitchButton::toggleMode);
|
||||
}
|
||||
|
||||
|
||||
|
||||
@@ -144,10 +144,11 @@ void BCMainWindow::initMainWindow()
|
||||
// also: emit dataChanged(index, index, {Qt::DisplayRole, Qt::EditRole, ValueRole});
|
||||
connect( _connectButton, &QToolButton::clicked, &_transmitter, &BCTransmitter::onToggleDriverConnection );
|
||||
connect( _syncButton, &QToolButton::clicked, this, &BCMainWindow::onSyncDeviceView );
|
||||
connect( &_transmitter, &BCTransmitter::valueUpdated, this, &BCMainWindow::onValueUpdated );
|
||||
connect( _exitButton, &QToolButton::clicked, qApp, &QCoreApplication::quit );
|
||||
|
||||
connect(this, &BCMainWindow::requestValueUpdate, &_transmitter, &BCTransmitter::onUpdateValue);
|
||||
connect(&_worker, &QThread::finished, &_transmitter, &QObject::deleteLater);
|
||||
connect( &_transmitter, &BCTransmitter::valueUpdated, this, &BCMainWindow::onValueUpdated );
|
||||
connect( this, &BCMainWindow::requestValueUpdate, &_transmitter, &BCTransmitter::onUpdateValue);
|
||||
connect( &_worker, &QThread::finished, &_transmitter, &QObject::deleteLater);
|
||||
connect( &_transmitter, &BCTransmitter::driverStateChanged, this, &BCMainWindow::onDriverStateChanged );
|
||||
|
||||
// transmitter starten
|
||||
@@ -186,15 +187,19 @@ void BCMainWindow::initStatusBar()
|
||||
statBar->addPermanentWidget(themeBtn);
|
||||
connect(themeBtn, &BCThemeSwitchButton::themeChanged, this, [this](bool isDark)
|
||||
{
|
||||
|
||||
QString message = isDark ? "Dark Mode Activated" : "Light Mode Activated";
|
||||
statusBar()->showMessage( message, 3000);
|
||||
setApplicationStyleSheet( isDark ? ":/claude_dark_mode.qss"_L1 : ":/claude_light_mode.qss"_L1 );
|
||||
setApplicationStyleSheet( isDark ? ":claude_dark_mode.qss"_L1 : ":claude_light_mode.qss"_L1 );
|
||||
});
|
||||
|
||||
// Wir starten im light mode
|
||||
//themeBtn->setDarkMode( false );
|
||||
|
||||
statBar->showMessage("Ready");
|
||||
|
||||
setApplicationStyleSheet(":bionxcontrol.qss"_L1);
|
||||
//setApplicationStyleSheet(":alt.qss"_L1);
|
||||
}
|
||||
|
||||
/*
|
||||
|
||||
@@ -142,7 +142,11 @@
|
||||
</size>
|
||||
</property>
|
||||
<property name="text">
|
||||
<string>SYNC</string>
|
||||
<string/>
|
||||
</property>
|
||||
<property name="icon">
|
||||
<iconset resource="bionxcontrol.qrc">
|
||||
<normaloff>:/sync_yellow.svg</normaloff>:/sync_yellow.svg</iconset>
|
||||
</property>
|
||||
<property name="iconSize">
|
||||
<size>
|
||||
@@ -164,7 +168,11 @@
|
||||
</size>
|
||||
</property>
|
||||
<property name="text">
|
||||
<string>CONNECT</string>
|
||||
<string/>
|
||||
</property>
|
||||
<property name="icon">
|
||||
<iconset resource="bionxcontrol.qrc">
|
||||
<normaloff>:/connect.svg</normaloff>:/connect.svg</iconset>
|
||||
</property>
|
||||
<property name="iconSize">
|
||||
<size>
|
||||
@@ -188,6 +196,10 @@
|
||||
<property name="text">
|
||||
<string>Quit</string>
|
||||
</property>
|
||||
<property name="icon">
|
||||
<iconset resource="bionxcontrol.qrc">
|
||||
<normaloff>:/exit_red.svg</normaloff>:/exit_red.svg</iconset>
|
||||
</property>
|
||||
<property name="iconSize">
|
||||
<size>
|
||||
<width>48</width>
|
||||
@@ -199,9 +211,6 @@
|
||||
</property>
|
||||
</widget>
|
||||
</item>
|
||||
|
||||
|
||||
|
||||
</layout>
|
||||
</widget>
|
||||
</item>
|
||||
@@ -315,11 +324,7 @@
|
||||
</item>
|
||||
</layout>
|
||||
</widget>
|
||||
<widget class="QStatusBar" name="_statusbar">
|
||||
<property name="styleSheet">
|
||||
<string notr="true">background-color: #DADADA</string>
|
||||
</property>
|
||||
</widget>
|
||||
<widget class="QStatusBar" name="_statusbar"/>
|
||||
<action name="_motorAction">
|
||||
<property name="icon">
|
||||
<iconset>
|
||||
@@ -329,7 +334,7 @@
|
||||
<string>motor</string>
|
||||
</property>
|
||||
<property name="toolTip">
|
||||
<string>Show motor settings</string>
|
||||
<string>Motoreinstellungen anzeigen und bearbeiten</string>
|
||||
</property>
|
||||
</action>
|
||||
<action name="_batteryAction">
|
||||
@@ -341,7 +346,7 @@
|
||||
<string>battery</string>
|
||||
</property>
|
||||
<property name="toolTip">
|
||||
<string>Show battery settings</string>
|
||||
<string>Batterieeinstellungen anzeigen und bearbeiten</string>
|
||||
</property>
|
||||
</action>
|
||||
<action name="_consoleAction">
|
||||
@@ -353,31 +358,19 @@
|
||||
<string>console</string>
|
||||
</property>
|
||||
<property name="toolTip">
|
||||
<string>Show console settings</string>
|
||||
</property>
|
||||
</action>
|
||||
<action name="_exitAction">
|
||||
<property name="icon">
|
||||
<iconset>
|
||||
<normaloff>:exit.svg</normaloff>:exit.svg</iconset>
|
||||
</property>
|
||||
<property name="text">
|
||||
<string>Exit</string>
|
||||
</property>
|
||||
<property name="toolTip">
|
||||
<string>Exit</string>
|
||||
<string>Konseleneinstellungen anzeigen und bearbeiten</string>
|
||||
</property>
|
||||
</action>
|
||||
<action name="_connectAction">
|
||||
<property name="icon">
|
||||
<iconset resource="bionxcontrol.qrc">
|
||||
<iconset>
|
||||
<normaloff>:/connected.png</normaloff>:/connected.png</iconset>
|
||||
</property>
|
||||
<property name="text">
|
||||
<string>connect</string>
|
||||
</property>
|
||||
<property name="toolTip">
|
||||
<string>connect to bike</string>
|
||||
<string>TinyCAN native Treiber laden</string>
|
||||
</property>
|
||||
<property name="menuRole">
|
||||
<enum>QAction::MenuRole::TextHeuristicRole</enum>
|
||||
|
||||
@@ -7,17 +7,13 @@
|
||||
<file alias="bionx_akku.png">resources/bionx_akku.png</file>
|
||||
<file alias="bionx_console.png">resources/bionx_console.png</file>
|
||||
<file alias="bionx_motor.png">resources/bionx_motor.png</file>
|
||||
<file alias="exit.png">resources/exit.png</file>
|
||||
<file alias="important.png">resources/important.png</file>
|
||||
<file alias="restart.png">resources/restart.png</file>
|
||||
<file alias="splash.png">resources/splash.png</file>
|
||||
<file alias="xconnect.png">resources/connect.png</file>
|
||||
<file alias="connected.png">resources/connected.png</file>
|
||||
<file alias="disconnected.png">resources/disconnected.png</file>
|
||||
<file>resources/connect_white.svg</file>
|
||||
<file alias="connect">resources/a_connect.svg</file>
|
||||
<file alias="exit.svg">resources/a_exit.svg</file>
|
||||
<file alias="sync_green">resources/a_sync_green.svg</file>
|
||||
<file alias="sync_yellow">resources/a_sync_yellow.svg</file>
|
||||
<file alias="connect.svg">resources/connect.svg</file>
|
||||
<file alias="exit.svg">resources/exit.svg</file>
|
||||
<file alias="exit_red.svg">resources/exit_red.svg</file>
|
||||
<file alias="sync_green.svg">resources/sync_green.svg</file>
|
||||
<file alias="sync_yellow.svg">resources/sync_yellow.svg</file>
|
||||
<file alias="alt.qss">resources/alt.qss</file>
|
||||
<file alias="connect_white.svg">resources/connect_white.svg</file>
|
||||
<file alias="sync.svg">resources/sync.svg</file>
|
||||
</qresource>
|
||||
</RCC>
|
||||
|
||||
120
resources/alt.qss
Normal file
@@ -0,0 +1,120 @@
|
||||
/* appqss */
|
||||
|
||||
/* Alle QWidgets bekommen diesen Font */
|
||||
QWidget
|
||||
{
|
||||
font-size: 14px;
|
||||
font-family: Segoe UI, sans-serif;
|
||||
}
|
||||
/*
|
||||
QMainWindow
|
||||
{
|
||||
background-color: #272727;
|
||||
}
|
||||
*/
|
||||
|
||||
/* Spezifisches Styling für Buttons */
|
||||
QPushButton
|
||||
{
|
||||
background-color: #0078d7;
|
||||
color: white;
|
||||
border-radius: 4px;
|
||||
padding: 6px;
|
||||
}
|
||||
|
||||
QPushButton:hover
|
||||
{
|
||||
background-color: #1084e3;
|
||||
}
|
||||
|
||||
QPushButton:pressed
|
||||
{
|
||||
background-color: #005a9e;
|
||||
}
|
||||
|
||||
/* Normal */
|
||||
QToolButton {
|
||||
background-color: transparent;
|
||||
border: 1px solid transparent;
|
||||
border-radius: 4px;
|
||||
padding: 4px;
|
||||
}
|
||||
|
||||
/* Hover */
|
||||
QToolButton:hover {
|
||||
background-color: #E3F2FD;
|
||||
border: 1px solid #2196F3;
|
||||
}
|
||||
|
||||
/* Pressed/Clicked */
|
||||
QToolButton:pressed {
|
||||
background-color: #BBDEFB;
|
||||
}
|
||||
|
||||
/* Checked (bei checkable buttons) */
|
||||
QToolButton:checked {
|
||||
background-color: #2196F3;
|
||||
color: white;
|
||||
}
|
||||
|
||||
/* Checked + Hover */
|
||||
QToolButton:checked:hover {
|
||||
background-color: #1976D2;
|
||||
}
|
||||
|
||||
/* Disabled */
|
||||
QToolButton:disabled {
|
||||
color: #BDBDBD;
|
||||
background-color: transparent;
|
||||
}
|
||||
|
||||
/*
|
||||
QTableView
|
||||
{
|
||||
background-color: #404142;
|
||||
border-radius: 8px;
|
||||
outline: none;
|
||||
show-decoration-selected: 0;
|
||||
}
|
||||
|
||||
QTableView::item
|
||||
{
|
||||
border: 2px solid #2196F3;
|
||||
border-radius: 8px;
|
||||
padding: 8px;
|
||||
margin: 4px;
|
||||
background-color: white;
|
||||
}
|
||||
*/
|
||||
|
||||
QTableView::item:hover
|
||||
{
|
||||
border-color: #FF9800;
|
||||
background-color: #fff8f0;
|
||||
}
|
||||
|
||||
QTableView::item:selected
|
||||
{
|
||||
border-color: #F44336; /* Roter Rahmen */
|
||||
background-color: #ffebee;
|
||||
}
|
||||
|
||||
QTableView::item:selected:hover
|
||||
{
|
||||
border-color: #FF9800;
|
||||
background-color: #ffe0b2;
|
||||
}
|
||||
*/
|
||||
|
||||
QTableView::item:focus
|
||||
{
|
||||
/*
|
||||
// outline: none; Entfernt das Focus-Rectangle
|
||||
// border-color: green;
|
||||
// background-color: #ffe0b2;
|
||||
*/
|
||||
border: 2px solid gray;
|
||||
border-style: inset;
|
||||
background-color: white;
|
||||
color: black;
|
||||
}
|
||||
@@ -3,118 +3,81 @@
|
||||
/* Alle QWidgets bekommen diesen Font */
|
||||
QWidget
|
||||
{
|
||||
font-size: 14px;
|
||||
font-family: Segoe UI, sans-serif;
|
||||
font-family: "Calibri", "Carlito", "Open Sans", sans-serif;
|
||||
font-size: 6pt;
|
||||
margin: 0px;
|
||||
padding: 0px;
|
||||
}
|
||||
|
||||
/*
|
||||
QMainWindow
|
||||
QToolButton
|
||||
{
|
||||
background-color: #272727;
|
||||
background-color: white;
|
||||
color: #201F1E;
|
||||
border: 1px solid #8A8886;
|
||||
border-radius: 4px;
|
||||
|
||||
|
||||
min-width: 64px;
|
||||
max-width: 64px;
|
||||
min-height: 64px;
|
||||
max-height: 64px;
|
||||
|
||||
}
|
||||
|
||||
QToolButton:hover
|
||||
{
|
||||
background-color: #F3F2F1;
|
||||
border: 1px solid #323130;
|
||||
}
|
||||
|
||||
QToolButton:pressed
|
||||
{
|
||||
background-color: #EDEBE9;
|
||||
border: 1px solid #201F1E;
|
||||
}
|
||||
|
||||
QToolButton:disabled
|
||||
{
|
||||
background-color: #F3F2F1;
|
||||
color: #A19F9D;
|
||||
border: 1px solid #EDEBE9;
|
||||
}
|
||||
*/
|
||||
|
||||
/* Spezifisches Styling für Buttons */
|
||||
QPushButton
|
||||
{
|
||||
background-color: #0078d7;
|
||||
color: white;
|
||||
/* === QToolButton === */
|
||||
QToolButton
|
||||
{
|
||||
background-color: transparent;
|
||||
color: #000000;
|
||||
border: none;
|
||||
border-radius: 4px;
|
||||
padding: 6px;
|
||||
|
||||
min-width: 64px;
|
||||
max-width: 64px;
|
||||
min-height: 64px;
|
||||
max-height: 64px;
|
||||
}
|
||||
|
||||
QPushButton:hover
|
||||
QToolButton:hover
|
||||
{
|
||||
background-color: #F9F9F9;
|
||||
border: 1px solid #DDDDDD;
|
||||
}
|
||||
|
||||
QToolButton:pressed
|
||||
{
|
||||
background-color: #1084e3;
|
||||
background-color: #E0E0E0;
|
||||
}
|
||||
|
||||
QPushButton:pressed
|
||||
QToolButton:checked
|
||||
{
|
||||
background-color: #005a9e;
|
||||
background-color: #0078D4;
|
||||
color: #FFFFFF;
|
||||
}
|
||||
|
||||
/* Normal */
|
||||
QToolButton {
|
||||
background-color: transparent;
|
||||
border: 1px solid transparent;
|
||||
border-radius: 4px;
|
||||
padding: 4px;
|
||||
}
|
||||
|
||||
/* Hover */
|
||||
QToolButton:hover {
|
||||
background-color: #E3F2FD;
|
||||
border: 1px solid #2196F3;
|
||||
}
|
||||
|
||||
/* Pressed/Clicked */
|
||||
QToolButton:pressed {
|
||||
background-color: #BBDEFB;
|
||||
}
|
||||
|
||||
/* Checked (bei checkable buttons) */
|
||||
QToolButton:checked {
|
||||
background-color: #2196F3;
|
||||
color: white;
|
||||
}
|
||||
|
||||
/* Checked + Hover */
|
||||
QToolButton:checked:hover {
|
||||
background-color: #1976D2;
|
||||
}
|
||||
|
||||
/* Disabled */
|
||||
QToolButton:disabled {
|
||||
color: #BDBDBD;
|
||||
background-color: transparent;
|
||||
}
|
||||
|
||||
/*
|
||||
QTableView
|
||||
{
|
||||
background-color: #404142;
|
||||
border-radius: 8px;
|
||||
outline: none;
|
||||
show-decoration-selected: 0;
|
||||
}
|
||||
|
||||
QTableView::item
|
||||
{
|
||||
border: 2px solid #2196F3;
|
||||
border-radius: 8px;
|
||||
padding: 8px;
|
||||
margin: 4px;
|
||||
background-color: white;
|
||||
}
|
||||
*/
|
||||
|
||||
QTableView::item:hover
|
||||
{
|
||||
border-color: #FF9800;
|
||||
background-color: #fff8f0;
|
||||
}
|
||||
|
||||
QTableView::item:selected
|
||||
{
|
||||
border-color: #F44336; /* Roter Rahmen */
|
||||
background-color: #ffebee;
|
||||
}
|
||||
|
||||
QTableView::item:selected:hover
|
||||
{
|
||||
border-color: #FF9800;
|
||||
background-color: #ffe0b2;
|
||||
}
|
||||
*/
|
||||
|
||||
QTableView::item:focus
|
||||
{
|
||||
/*
|
||||
// outline: none; Entfernt das Focus-Rectangle
|
||||
// border-color: green;
|
||||
// background-color: #ffe0b2;
|
||||
*/
|
||||
border: 2px solid gray;
|
||||
border-style: inset;
|
||||
background-color: white;
|
||||
color: black;
|
||||
QToolButton:disabled
|
||||
{
|
||||
color: #A19F9D;
|
||||
}
|
||||
|
Before Width: | Height: | Size: 7.3 KiB |
|
Before Width: | Height: | Size: 1.1 KiB After Width: | Height: | Size: 1.1 KiB |
|
Before Width: | Height: | Size: 5.9 KiB |
|
Before Width: | Height: | Size: 6.5 KiB |
|
Before Width: | Height: | Size: 2.0 KiB |
|
Before Width: | Height: | Size: 2.2 KiB |
|
Before Width: | Height: | Size: 2.3 KiB |
|
Before Width: | Height: | Size: 1.9 KiB |
|
Before Width: | Height: | Size: 16 KiB |
|
Before Width: | Height: | Size: 599 B After Width: | Height: | Size: 599 B |
1
resources/exit_red.svg
Normal file
@@ -0,0 +1 @@
|
||||
<svg width="24" height="24" fill="none" viewBox="0 0 24 24" xmlns="http://www.w3.org/2000/svg"><path d="M12 2c5.523 0 10 4.477 10 10s-4.477 10-10 10S2 17.523 2 12 6.477 2 12 2Zm0 1.5a8.5 8.5 0 1 0 0 17 8.5 8.5 0 0 0 0-17Zm3.446 4.897.084.073a.75.75 0 0 1 .073.976l-.073.084L13.061 12l2.47 2.47a.75.75 0 0 1 .072.976l-.073.084a.75.75 0 0 1-.976.073l-.084-.073L12 13.061l-2.47 2.47a.75.75 0 0 1-.976.072l-.084-.073a.75.75 0 0 1-.073-.976l.073-.084L10.939 12l-2.47-2.47a.75.75 0 0 1-.072-.976l.073-.084a.75.75 0 0 1 .976-.073l.084.073L12 10.939l2.47-2.47a.75.75 0 0 1 .976-.072Z" fill="#FF0000"/></svg>
|
||||
|
After Width: | Height: | Size: 599 B |
|
Before Width: | Height: | Size: 1.9 KiB |
|
Before Width: | Height: | Size: 2.2 KiB |
|
Before Width: | Height: | Size: 1.9 KiB |
|
Before Width: | Height: | Size: 13 KiB |
|
Before Width: | Height: | Size: 13 KiB |
|
Before Width: | Height: | Size: 514 KiB |
1
resources/sync.svg
Normal file
@@ -0,0 +1 @@
|
||||
<svg width="48" height="48" fill="none" viewBox="0 0 24 24" xmlns="http://www.w3.org/2000/svg"><path d="M16 8.25a.75.75 0 0 1 1.5 0v3.25a.75.75 0 0 1-.75.75H14a.75.75 0 0 1 0-1.5h1.27A3.502 3.502 0 0 0 12 8.5c-1.093 0-2.037.464-2.673 1.23a.75.75 0 1 1-1.154-.96C9.096 7.66 10.463 7 12 7c1.636 0 3.088.785 4 2v-.75ZM8 15v.75a.75.75 0 0 1-1.5 0v-3a.75.75 0 0 1 .75-.75H10a.75.75 0 0 1 0 1.5H8.837a3.513 3.513 0 0 0 5.842.765.75.75 0 1 1 1.142.972A5.013 5.013 0 0 1 8 15Zm4-13C6.477 2 2 6.477 2 12s4.477 10 10 10 10-4.477 10-10S17.523 2 12 2Zm8.5 10a8.5 8.5 0 1 1-17 0 8.5 8.5 0 0 1 17 0Z" fill="#000000"/></svg>
|
||||
|
After Width: | Height: | Size: 609 B |
|
Before Width: | Height: | Size: 609 B After Width: | Height: | Size: 609 B |
|
Before Width: | Height: | Size: 609 B After Width: | Height: | Size: 609 B |