First steps.

This commit is contained in:
2026-01-06 13:05:19 +01:00
parent 5c52b1e936
commit c21bb2cf4e
30 changed files with 232 additions and 151 deletions

View File

@@ -43,23 +43,25 @@ BCThemeSwitchButton::BCThemeSwitchButton(QWidget *parent )
// CSS: Transparent, damit es sich nahtlos in den StatusBar einfügt // CSS: Transparent, damit es sich nahtlos in den StatusBar einfügt
// Schriftgröße etwas erhöhen, damit die Emojis gut erkennbar sind // Schriftgröße etwas erhöhen, damit die Emojis gut erkennbar sind
/*
setStyleSheet(R"( setStyleSheet(R"(
QPushButton { BCThemeSwitchButton
{
border: none; border: none;
background-color: transparent; background-color: green;
font-size: 11pt; font-size: 11pt;
} }
QPushButton:hover { BCThemeSwitchButton:Hover
background-color: rgba(128, 128, 128, 30); // Leichter Hover-Effekt {
background-color: rgba(128, 128, 128, 30);
border-radius: 24px; border-radius: 24px;
} }
)"); )");
*/
// Initialer Status (Startet im Dark Mode -> zeigt Mond) // Initialer Status (Startet im Dark Mode -> zeigt Mond)
updateIcon(); updateIcon();
connect(this, &QPushButton::clicked, this, &BCThemeSwitchButton::toggle); connect(this, &QPushButton::clicked, this, &BCThemeSwitchButton::toggleMode);
} }

View File

@@ -144,10 +144,11 @@ void BCMainWindow::initMainWindow()
// also: emit dataChanged(index, index, {Qt::DisplayRole, Qt::EditRole, ValueRole}); // also: emit dataChanged(index, index, {Qt::DisplayRole, Qt::EditRole, ValueRole});
connect( _connectButton, &QToolButton::clicked, &_transmitter, &BCTransmitter::onToggleDriverConnection ); connect( _connectButton, &QToolButton::clicked, &_transmitter, &BCTransmitter::onToggleDriverConnection );
connect( _syncButton, &QToolButton::clicked, this, &BCMainWindow::onSyncDeviceView ); 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( &_transmitter, &BCTransmitter::valueUpdated, this, &BCMainWindow::onValueUpdated );
connect(&_worker, &QThread::finished, &_transmitter, &QObject::deleteLater); connect( this, &BCMainWindow::requestValueUpdate, &_transmitter, &BCTransmitter::onUpdateValue);
connect( &_worker, &QThread::finished, &_transmitter, &QObject::deleteLater);
connect( &_transmitter, &BCTransmitter::driverStateChanged, this, &BCMainWindow::onDriverStateChanged ); connect( &_transmitter, &BCTransmitter::driverStateChanged, this, &BCMainWindow::onDriverStateChanged );
// transmitter starten // transmitter starten
@@ -186,15 +187,19 @@ void BCMainWindow::initStatusBar()
statBar->addPermanentWidget(themeBtn); statBar->addPermanentWidget(themeBtn);
connect(themeBtn, &BCThemeSwitchButton::themeChanged, this, [this](bool isDark) connect(themeBtn, &BCThemeSwitchButton::themeChanged, this, [this](bool isDark)
{ {
QString message = isDark ? "Dark Mode Activated" : "Light Mode Activated"; QString message = isDark ? "Dark Mode Activated" : "Light Mode Activated";
statusBar()->showMessage( message, 3000); 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 // Wir starten im light mode
//themeBtn->setDarkMode( false ); //themeBtn->setDarkMode( false );
statBar->showMessage("Ready"); statBar->showMessage("Ready");
setApplicationStyleSheet(":bionxcontrol.qss"_L1);
//setApplicationStyleSheet(":alt.qss"_L1);
} }
/* /*

View File

@@ -120,7 +120,7 @@
</property> </property>
</widget> </widget>
</item> </item>
<item> <item>
<spacer name="verticalSpacer"> <spacer name="verticalSpacer">
<property name="orientation"> <property name="orientation">
<enum>Qt::Orientation::Vertical</enum> <enum>Qt::Orientation::Vertical</enum>
@@ -142,7 +142,11 @@
</size> </size>
</property> </property>
<property name="text"> <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>
<property name="iconSize"> <property name="iconSize">
<size> <size>
@@ -164,7 +168,11 @@
</size> </size>
</property> </property>
<property name="text"> <property name="text">
<string>CONNECT</string> <string/>
</property>
<property name="icon">
<iconset resource="bionxcontrol.qrc">
<normaloff>:/connect.svg</normaloff>:/connect.svg</iconset>
</property> </property>
<property name="iconSize"> <property name="iconSize">
<size> <size>
@@ -188,6 +196,10 @@
<property name="text"> <property name="text">
<string>Quit</string> <string>Quit</string>
</property> </property>
<property name="icon">
<iconset resource="bionxcontrol.qrc">
<normaloff>:/exit_red.svg</normaloff>:/exit_red.svg</iconset>
</property>
<property name="iconSize"> <property name="iconSize">
<size> <size>
<width>48</width> <width>48</width>
@@ -199,9 +211,6 @@
</property> </property>
</widget> </widget>
</item> </item>
</layout> </layout>
</widget> </widget>
</item> </item>
@@ -315,11 +324,7 @@
</item> </item>
</layout> </layout>
</widget> </widget>
<widget class="QStatusBar" name="_statusbar"> <widget class="QStatusBar" name="_statusbar"/>
<property name="styleSheet">
<string notr="true">background-color: #DADADA</string>
</property>
</widget>
<action name="_motorAction"> <action name="_motorAction">
<property name="icon"> <property name="icon">
<iconset> <iconset>
@@ -329,7 +334,7 @@
<string>motor</string> <string>motor</string>
</property> </property>
<property name="toolTip"> <property name="toolTip">
<string>Show motor settings</string> <string>Motoreinstellungen anzeigen und bearbeiten</string>
</property> </property>
</action> </action>
<action name="_batteryAction"> <action name="_batteryAction">
@@ -341,7 +346,7 @@
<string>battery</string> <string>battery</string>
</property> </property>
<property name="toolTip"> <property name="toolTip">
<string>Show battery settings</string> <string>Batterieeinstellungen anzeigen und bearbeiten</string>
</property> </property>
</action> </action>
<action name="_consoleAction"> <action name="_consoleAction">
@@ -353,31 +358,19 @@
<string>console</string> <string>console</string>
</property> </property>
<property name="toolTip"> <property name="toolTip">
<string>Show console settings</string> <string>Konseleneinstellungen anzeigen und bearbeiten</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>
</property> </property>
</action> </action>
<action name="_connectAction"> <action name="_connectAction">
<property name="icon"> <property name="icon">
<iconset resource="bionxcontrol.qrc"> <iconset>
<normaloff>:/connected.png</normaloff>:/connected.png</iconset> <normaloff>:/connected.png</normaloff>:/connected.png</iconset>
</property> </property>
<property name="text"> <property name="text">
<string>connect</string> <string>connect</string>
</property> </property>
<property name="toolTip"> <property name="toolTip">
<string>connect to bike</string> <string>TinyCAN native Treiber laden</string>
</property> </property>
<property name="menuRole"> <property name="menuRole">
<enum>QAction::MenuRole::TextHeuristicRole</enum> <enum>QAction::MenuRole::TextHeuristicRole</enum>

View File

@@ -7,17 +7,13 @@
<file alias="bionx_akku.png">resources/bionx_akku.png</file> <file alias="bionx_akku.png">resources/bionx_akku.png</file>
<file alias="bionx_console.png">resources/bionx_console.png</file> <file alias="bionx_console.png">resources/bionx_console.png</file>
<file alias="bionx_motor.png">resources/bionx_motor.png</file> <file alias="bionx_motor.png">resources/bionx_motor.png</file>
<file alias="exit.png">resources/exit.png</file> <file alias="connect.svg">resources/connect.svg</file>
<file alias="important.png">resources/important.png</file> <file alias="exit.svg">resources/exit.svg</file>
<file alias="restart.png">resources/restart.png</file> <file alias="exit_red.svg">resources/exit_red.svg</file>
<file alias="splash.png">resources/splash.png</file> <file alias="sync_green.svg">resources/sync_green.svg</file>
<file alias="xconnect.png">resources/connect.png</file> <file alias="sync_yellow.svg">resources/sync_yellow.svg</file>
<file alias="connected.png">resources/connected.png</file> <file alias="alt.qss">resources/alt.qss</file>
<file alias="disconnected.png">resources/disconnected.png</file> <file alias="connect_white.svg">resources/connect_white.svg</file>
<file>resources/connect_white.svg</file> <file alias="sync.svg">resources/sync.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>
</qresource> </qresource>
</RCC> </RCC>

Binary file not shown.

120
resources/alt.qss Normal file
View 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;
}

View File

@@ -3,118 +3,81 @@
/* Alle QWidgets bekommen diesen Font */ /* Alle QWidgets bekommen diesen Font */
QWidget QWidget
{ {
font-size: 14px; font-family: "Calibri", "Carlito", "Open Sans", sans-serif;
font-family: Segoe UI, 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 */ /* === QToolButton === */
QPushButton QToolButton
{ {
background-color: #0078d7; background-color: transparent;
color: white; color: #000000;
border: none;
border-radius: 4px; border-radius: 4px;
padding: 6px; 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:disabled
QToolButton { {
background-color: transparent; color: #A19F9D;
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;
}

Binary file not shown.

Before

Width:  |  Height:  |  Size: 7.3 KiB

View File

Before

Width:  |  Height:  |  Size: 1.1 KiB

After

Width:  |  Height:  |  Size: 1.1 KiB

Binary file not shown.

Before

Width:  |  Height:  |  Size: 5.9 KiB

Binary file not shown.

Before

Width:  |  Height:  |  Size: 6.5 KiB

Binary file not shown.

Before

Width:  |  Height:  |  Size: 2.0 KiB

Binary file not shown.

Before

Width:  |  Height:  |  Size: 2.2 KiB

Binary file not shown.

Before

Width:  |  Height:  |  Size: 2.3 KiB

Binary file not shown.

Before

Width:  |  Height:  |  Size: 1.9 KiB

Binary file not shown.

Before

Width:  |  Height:  |  Size: 16 KiB

View File

Before

Width:  |  Height:  |  Size: 599 B

After

Width:  |  Height:  |  Size: 599 B

1
resources/exit_red.svg Normal file
View 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

Binary file not shown.

Before

Width:  |  Height:  |  Size: 1.9 KiB

Binary file not shown.

Before

Width:  |  Height:  |  Size: 2.2 KiB

Binary file not shown.

Before

Width:  |  Height:  |  Size: 1.9 KiB

Binary file not shown.

Before

Width:  |  Height:  |  Size: 13 KiB

Binary file not shown.

Before

Width:  |  Height:  |  Size: 13 KiB

Binary file not shown.

Binary file not shown.

Before

Width:  |  Height:  |  Size: 514 KiB

1
resources/sync.svg Normal file
View 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

View File

Before

Width:  |  Height:  |  Size: 609 B

After

Width:  |  Height:  |  Size: 609 B

View File

Before

Width:  |  Height:  |  Size: 609 B

After

Width:  |  Height:  |  Size: 609 B