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
+14 -4
View File
@@ -6,7 +6,7 @@ ResponsiveQLabel::ResponsiveQLabel(QWidget *parent) : QLabel(parent)
{
setAlignment(Qt::AlignCenter);
setScaledContents(false);
setSizePolicy(QSizePolicy::Ignored, QSizePolicy::Expanding);
setSizePolicy(QSizePolicy::Fixed, QSizePolicy::Fixed);
setMinimumSize(100, 100);
}
@@ -44,13 +44,23 @@ void ResponsiveQLabel::paintEvent(QPaintEvent *event)
void ResponsiveQLabel::updateScaledPixmap()
{
if (m_originalPixmap.isNull() || size().isEmpty()) {
if (m_originalPixmap.isNull()) {
return;
}
// Use the minimum width as the constraint for scaling
int targetWidth = qMax(minimumWidth(), width());
// Scale the pixmap while maintaining aspect ratio
m_scaledPixmap = m_originalPixmap.scaled(size(), Qt::KeepAspectRatio,
Qt::SmoothTransformation);
m_scaledPixmap =
m_originalPixmap.scaled(targetWidth, QWIDGETSIZE_MAX,
Qt::KeepAspectRatio, Qt::SmoothTransformation);
// Resize the widget to match the scaled pixmap size
// This prevents the widget from taking up more space than the actual image
if (!m_scaledPixmap.isNull()) {
setFixedSize(m_scaledPixmap.size());
}
update();
}