Skip to content

Commit

Permalink
Update Theme
Browse files Browse the repository at this point in the history
Mostly HiDPI stuff.
  • Loading branch information
rodlie committed Aug 11, 2024
1 parent 0ce7661 commit 80eb375
Show file tree
Hide file tree
Showing 5 changed files with 37 additions and 26 deletions.
24 changes: 15 additions & 9 deletions src/app/GUI/RenderWidgets/renderwidget.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -54,6 +54,10 @@ RenderWidget::RenderWidget(QWidget *parent)
mMainLayout->setSpacing(0);
setLayout(mMainLayout);

const auto topWidget = new QWidget(this);
topWidget->setContentsMargins(0, 0, 0, 0);
const auto topLayout = new QHBoxLayout(topWidget);

const auto bottomWidget = new QWidget(this);
bottomWidget->setContentsMargins(0, 0, 0, 0);
const auto bottomLayout = new QHBoxLayout(bottomWidget);
Expand All @@ -62,11 +66,13 @@ RenderWidget::RenderWidget(QWidget *parent)
setAutoFillBackground(true);

bottomWidget->setSizePolicy(QSizePolicy::Expanding, QSizePolicy::Minimum);
topWidget->setSizePolicy(QSizePolicy::Expanding, QSizePolicy::Minimum);

mRenderProgressBar = new QProgressBar(this);
mRenderProgressBar->setMinimumWidth(10);
setSizePolicy(QSizePolicy::Expanding,
QSizePolicy::Expanding);
mRenderProgressBar->setFormat(tr("Idle"));
mRenderProgressBar->setFormat("");
mRenderProgressBar->setValue(0);

mStartRenderButton = new QPushButton(QIcon::fromTheme("render_animation"),
Expand Down Expand Up @@ -138,12 +144,15 @@ RenderWidget::RenderWidget(QWidget *parent)
mScrollArea->setWidgetResizable(true);
mScrollArea->setHorizontalScrollBarPolicy(Qt::ScrollBarAlwaysOff);

topLayout->addStretch();
topLayout->addWidget(mAddRenderButton);
topLayout->addWidget(mClearQueueButton);

bottomLayout->addWidget(mStartRenderButton);
bottomLayout->addWidget(mStopRenderButton);
bottomLayout->addWidget(mRenderProgressBar);
bottomLayout->addWidget(mAddRenderButton);
bottomLayout->addWidget(mClearQueueButton);
bottomLayout->addWidget(mStopRenderButton);

mMainLayout->addWidget(topWidget);
mMainLayout->addWidget(mScrollArea);
mMainLayout->addWidget(bottomWidget);

Expand Down Expand Up @@ -200,22 +209,19 @@ void RenderWidget::handleRenderState(const RenderState &state)
QString renderStateFormat;
switch (mState) {
case RenderState::rendering:
renderStateFormat = tr("Rendering %p%");
renderStateFormat = tr("%p%");
break;
case RenderState::error:
renderStateFormat = tr("Error");
break;
case RenderState::finished:
renderStateFormat = tr("Finished");
break;
case RenderState::paused:
renderStateFormat = tr("Paused %p%");
break;
case RenderState::waiting:
renderStateFormat = tr("Waiting %p%");
break;
default:
renderStateFormat = tr("Idle");
renderStateFormat = "";
break;
}
bool isIdle = (mState == RenderState::error ||
Expand Down
15 changes: 9 additions & 6 deletions src/app/GUI/fontswidget.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -50,14 +50,17 @@ FontsWidget::FontsWidget(QWidget *parent)
, mColorButton(nullptr)
{
mFontStyleCombo = new QComboBox(this);
mFontStyleCombo->setMinimumWidth(20);
mFontStyleCombo->setFocusPolicy(Qt::NoFocus);
mFontStyleCombo->setToolTip(tr("Font style"));

mFontFamilyCombo = new QComboBox(this);
mFontFamilyCombo->setMinimumWidth(20);
mFontFamilyCombo->setFocusPolicy(Qt::NoFocus);
mFontFamilyCombo->setToolTip(tr("Font family"));

mFontSizeCombo = new EditableComboBox(this, true);
mFontSizeCombo->setMinimumWidth(20);
mFontSizeCombo->setCompleter(nullptr);
mFontSizeCombo->setMinimumContentsLength(3);
mFontSizeCombo->setToolTip(tr("Font size"));
Expand Down Expand Up @@ -89,25 +92,25 @@ FontsWidget::FontsWidget(QWidget *parent)
mFontStyleCombo->setSizePolicy(QSizePolicy::Expanding, QSizePolicy::Preferred);
mFontSizeCombo->setSizePolicy(QSizePolicy::Expanding, QSizePolicy::Preferred);

QLabel *fontFamilyLabel = new QLabel(tr("Family"), this);
QLabel *fontStyleLabel = new QLabel(tr("Style"), this);
QLabel *fontSizeLabel = new QLabel(tr("Size"), this);
// QLabel *fontFamilyLabel = new QLabel(tr("Family"), this);
// QLabel *fontStyleLabel = new QLabel(tr("Style"), this);
// QLabel *fontSizeLabel = new QLabel(tr("Size"), this);

QWidget *fontFamilyWidget = new QWidget(this);
fontFamilyWidget->setContentsMargins(0, 0, 0, 0);
QHBoxLayout *fontFamilyLayout = new QHBoxLayout(fontFamilyWidget);
fontFamilyLayout->setMargin(0);
fontFamilyLayout->addWidget(fontFamilyLabel);
// fontFamilyLayout->addWidget(fontFamilyLabel);
fontFamilyLayout->addWidget(mFontFamilyCombo);

QWidget *fontStyleWidget = new QWidget(this);
fontStyleWidget->setContentsMargins(0, 0, 0 ,0);
QHBoxLayout *fontStyleLayout = new QHBoxLayout(fontStyleWidget);
fontStyleLayout->setMargin(0);

fontStyleLayout->addWidget(fontStyleLabel);
// fontStyleLayout->addWidget(fontStyleLabel);
fontStyleLayout->addWidget(mFontStyleCombo);
fontStyleLayout->addWidget(fontSizeLabel);
// fontStyleLayout->addWidget(fontSizeLabel);
fontStyleLayout->addWidget(mFontSizeCombo);
fontStyleLayout->addWidget(mColorButton);

Expand Down
8 changes: 4 additions & 4 deletions src/app/GUI/layouthandler.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -55,9 +55,9 @@ LayoutHandler::LayoutHandler(Document& document,
newLayPush->setObjectName("FlatButton");
eSizesUI::widget.add(newLayPush, [newLayPush](const int size) {
newLayPush->setFixedSize(QSize(size, size));
if (eSettings::instance().fCurrentInterfaceDPI != 1.) {
/*if (eSettings::instance().fCurrentInterfaceDPI != 1.) {
newLayPush->setIconSize(QSize(size, size));
}
}*/
});
//newLayPush->setSizePolicy(QSizePolicy::Fixed, QSizePolicy::Minimum);

Expand All @@ -67,9 +67,9 @@ LayoutHandler::LayoutHandler(Document& document,
removeLayPush->setObjectName("FlatButton");
eSizesUI::widget.add(removeLayPush, [removeLayPush](const int size) {
removeLayPush->setFixedSize(QSize(size, size));
if (eSettings::instance().fCurrentInterfaceDPI != 1.) {
/*if (eSettings::instance().fCurrentInterfaceDPI != 1.) {
removeLayPush->setIconSize(QSize(size, size));
}
}*/
});
//removeLayPush->setSizePolicy(QSizePolicy::Fixed, QSizePolicy::Minimum);

Expand Down
2 changes: 1 addition & 1 deletion src/app/friction.qss
Original file line number Diff line number Diff line change
Expand Up @@ -500,5 +500,5 @@ QProgressBar {

QProgressBar::chunk {
background-color: %9;
width: 10px;
width: 5px;
}
14 changes: 8 additions & 6 deletions src/ui/widgets/alignwidget.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -44,20 +44,22 @@ AlignWidget::AlignWidget(QWidget* const parent)
const auto combosLay = new QHBoxLayout;
mainLayout->addLayout(combosLay);

combosLay->addWidget(new QLabel(tr("Align")));
//combosLay->addWidget(new QLabel(tr("Align")));
mAlignPivot = new QComboBox(this);
mAlignPivot->setMinimumWidth(20);
mAlignPivot->setSizePolicy(QSizePolicy::Expanding, QSizePolicy::Expanding);
mAlignPivot->setFocusPolicy(Qt::NoFocus);
mAlignPivot->addItem(tr("Geometry"));
mAlignPivot->addItem(tr("Pivot"));
mAlignPivot->addItem(tr("Align Geometry"));
mAlignPivot->addItem(tr("Align Pivot"));
combosLay->addWidget(mAlignPivot);

combosLay->addWidget(new QLabel(tr("Relative to")));
//combosLay->addWidget(new QLabel(tr("Relative to")));
mRelativeTo = new QComboBox(this);
mRelativeTo->setMinimumWidth(20);
mRelativeTo->setSizePolicy(QSizePolicy::Expanding, QSizePolicy::Expanding);
mRelativeTo->setFocusPolicy(Qt::NoFocus);
mRelativeTo->addItem(tr("Scene"));
mRelativeTo->addItem(tr("Last Selected"));
mRelativeTo->addItem(tr("Relative to Scene"));
mRelativeTo->addItem(tr("Relative to Last Selected"));
combosLay->addWidget(mRelativeTo);

const auto buttonsLay = new QHBoxLayout;
Expand Down

0 comments on commit 80eb375

Please sign in to comment.