improve UI styles

- Added album path management in PhotoModel for better photo loading.
- Updated responsive QLabel to handle scaling more effectively.
- Introduced ClickableIconWidget for better icon interaction in the UI.
- Added new color definitions for blue and accent blue.
- Enhanced the AppTabWidget styles to adapt to dark mode.
- Replaced QLineEdit with ZLineEdit for consistent styling.
- Improved the SSH terminal widget with better error handling and process management.
- Refactored ToolboxWidget methods for device management.
- Adjusted margins and styles in various widgets for improved layout.
This commit is contained in:
uncor3
2025-10-09 21:24:45 -07:00
parent 777ea21a00
commit 8d4f4b11f9
33 changed files with 1067 additions and 430 deletions
+5 -2
View File
@@ -1,6 +1,7 @@
// https://github.com/p-dobrzynski-dev/QtCustomWidgets/blob/master/batterywidget.cpp
#include "batterywidget.h"
#include <QApplication>
#include <QDebug>
#include <QFontMetrics>
#include <QPainter>
@@ -12,6 +13,8 @@ BatteryWidget::BatteryWidget(float value, bool isCharging, QWidget *parent)
{
setMinimumSize(30, 30);
setMaximumSize(40, 40);
connect(qApp, &QApplication::paletteChanged, this, [this]() { update(); });
}
void BatteryWidget::resizeEvent(QResizeEvent *)
@@ -83,7 +86,6 @@ void BatteryWidget::paintEvent(QPaintEvent *)
QBrush brush = QBrush(Qt::white);
painter.setPen(pen);
// Drawing battery frame
float widgetCorner = widgetFrame.height() / 15;
@@ -108,10 +110,11 @@ void BatteryWidget::paintEvent(QPaintEvent *)
batteryLevelRect.moveTo(batteryLevelFrame.topLeft());
painter.drawRoundedRect(batteryLevelRect, widgetCorner, widgetCorner);
pen.setColor(Qt::white);
pen.setColor(palette().color(QPalette::Text));
painter.setPen(pen);
QFont textFont = QFont();
textFont.setPixelSize(widgetFrame.height() / 1.65);
textFont.setWeight(QFont::Bold);
painter.setFont(textFont);
QFontMetrics fm(textFont);
QString percentageLevelString = QString("%1%").arg(m_value);