Skip to content

Commit

Permalink
V1.3.1 - horizontal offset refinement
Browse files Browse the repository at this point in the history
  • Loading branch information
sardid committed Sep 5, 2022
1 parent d026074 commit fb8e165
Show file tree
Hide file tree
Showing 6 changed files with 22 additions and 17 deletions.
2 changes: 1 addition & 1 deletion CMakeLists.txt
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@

project(sierrabreezeenhanced)
set(PROJECT_VERSION "1.3.0")
set(PROJECT_VERSION "1.3.1")
set(PROJECT_VERSION_MAJOR 0)

cmake_minimum_required(VERSION 2.8.12 FATAL_ERROR)
Expand Down
5 changes: 5 additions & 0 deletions ChangeLog
Original file line number Diff line number Diff line change
@@ -1,4 +1,9 @@

V1.3.1
---------

* Horizontal offset refinement

V1.3.0
---------

Expand Down
10 changes: 5 additions & 5 deletions breezedecoration.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -832,7 +832,7 @@ namespace Breeze
// padding
const int vPadding = isTopEdge() ? 0 : s->smallSpacing()*Metrics::TitleBar_TopMargin;
const int hPadding = s->smallSpacing()*Metrics::TitleBar_SideMargin;
const int hMargin = 0.5*s->smallSpacing()*m_internalSettings->buttonPadding() + 0.5*s->smallSpacing()*m_internalSettings->buttonHOffset();
const int hMargin = 0.5*s->smallSpacing()*m_internalSettings->buttonPadding() + 0.5*s->smallSpacing()*m_internalSettings->hOffset();

// left buttons
if( !m_leftButtons->buttons().isEmpty() )
Expand Down Expand Up @@ -1016,12 +1016,12 @@ namespace Breeze
auto s = settings();
auto c = client().toStrongRef().data();
const int leftOffset = m_leftButtons->buttons().isEmpty() ?
Metrics::TitleBar_SideMargin*settings()->smallSpacing() + 0.5*s->smallSpacing()*m_internalSettings->buttonPadding() + 0.5*s->smallSpacing()*m_internalSettings->buttonHOffset():
m_leftButtons->geometry().x() + m_leftButtons->geometry().width() + Metrics::TitleBar_SideMargin*settings()->smallSpacing() + 0.5*s->smallSpacing()*m_internalSettings->buttonPadding() + 0.5*s->smallSpacing()*m_internalSettings->buttonHOffset();
Metrics::TitleBar_SideMargin*settings()->smallSpacing() + 0.5*s->smallSpacing()*m_internalSettings->buttonPadding() + 0.5*s->smallSpacing()*m_internalSettings->hOffset() :
m_leftButtons->geometry().x() + m_leftButtons->geometry().width() + Metrics::TitleBar_SideMargin*settings()->smallSpacing() + 0.5*s->smallSpacing()*m_internalSettings->buttonPadding() ;

const int rightOffset = m_rightButtons->buttons().isEmpty() ?
Metrics::TitleBar_SideMargin*settings()->smallSpacing() + 0.5*s->smallSpacing()*m_internalSettings->buttonPadding() + 0.5*s->smallSpacing()*m_internalSettings->buttonHOffset() :
size().width() - m_rightButtons->geometry().x() + Metrics::TitleBar_SideMargin*settings()->smallSpacing() + 0.5*s->smallSpacing()*m_internalSettings->buttonPadding() + 0.5*s->smallSpacing()*m_internalSettings->buttonHOffset();
Metrics::TitleBar_SideMargin*settings()->smallSpacing() + 0.5*s->smallSpacing()*m_internalSettings->buttonPadding() + 0.5*s->smallSpacing()*m_internalSettings->hOffset() :
size().width() - m_rightButtons->geometry().x() + Metrics::TitleBar_SideMargin*settings()->smallSpacing() + 0.5*s->smallSpacing()*m_internalSettings->buttonPadding() ;

const int yOffset = settings()->smallSpacing()*Metrics::TitleBar_TopMargin;
const QRect maxRect( leftOffset, yOffset, size().width() - leftOffset - rightOffset, captionHeight() );
Expand Down
2 changes: 1 addition & 1 deletion breezesettingsdata.kcfg
Original file line number Diff line number Diff line change
Expand Up @@ -129,7 +129,7 @@
<default>4</default>
</entry>

<entry name="ButtonHOffset" type = "Int">
<entry name="hOffset" type = "Int">
<default>0</default>
</entry>

Expand Down
10 changes: 5 additions & 5 deletions config/breezeconfigwidget.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -50,7 +50,7 @@ namespace Breeze
connect( m_ui.buttonSize, SIGNAL(currentIndexChanged(int)), SLOT(updateChanged()) );
connect( m_ui.buttonSpacing, QOverload<int>::of(&QSpinBox::valueChanged), [=](int /*i*/){updateChanged();} );
connect( m_ui.buttonPadding, SIGNAL(valueChanged(int)), SLOT(updateChanged()) );
connect( m_ui.buttonHOffset, SIGNAL(valueChanged(int)), SLOT(updateChanged()) );
connect( m_ui.hOffset, SIGNAL(valueChanged(int)), SLOT(updateChanged()) );
connect( m_ui.unisonHovering, &QAbstractButton::clicked, this, &ConfigWidget::updateChanged );
connect( m_ui.cornerRadiusSpinBox, QOverload<int>::of(&QSpinBox::valueChanged), [=](int /*i*/){updateChanged();} );
connect( m_ui.drawBorderOnMaximizedWindows, &QAbstractButton::clicked, this, &ConfigWidget::updateChanged );
Expand Down Expand Up @@ -96,7 +96,7 @@ namespace Breeze
m_ui.buttonSize->setCurrentIndex( m_internalSettings->buttonSize() );
m_ui.buttonSpacing->setValue( m_internalSettings->buttonSpacing() );
m_ui.buttonPadding->setValue( m_internalSettings->buttonPadding() );
m_ui.buttonHOffset->setValue( m_internalSettings->buttonHOffset() );
m_ui.hOffset->setValue( m_internalSettings->hOffset() );
m_ui.unisonHovering->setChecked( m_internalSettings->unisonHovering() );
m_ui.cornerRadiusSpinBox->setValue( m_internalSettings->cornerRadius() );
m_ui.drawBorderOnMaximizedWindows->setChecked( m_internalSettings->drawBorderOnMaximizedWindows() );
Expand Down Expand Up @@ -147,7 +147,7 @@ namespace Breeze
m_internalSettings->setButtonSize( m_ui.buttonSize->currentIndex() );
m_internalSettings->setButtonSpacing( m_ui.buttonSpacing->value() );
m_internalSettings->setButtonPadding( m_ui.buttonPadding->value() );
m_internalSettings->setButtonHOffset( m_ui.buttonHOffset->value() );
m_internalSettings->setHOffset( m_ui.hOffset->value() );
m_internalSettings->setUnisonHovering( m_ui.unisonHovering->isChecked() );
m_internalSettings->setCornerRadius( m_ui.cornerRadiusSpinBox->value() );
m_internalSettings->setDrawBorderOnMaximizedWindows( m_ui.drawBorderOnMaximizedWindows->isChecked() );
Expand Down Expand Up @@ -212,7 +212,7 @@ namespace Breeze
m_ui.buttonSize->setCurrentIndex( m_internalSettings->buttonSize() );
m_ui.buttonSpacing->setValue( m_internalSettings->buttonSpacing() );
m_ui.buttonPadding->setValue( m_internalSettings->buttonPadding() );
m_ui.buttonHOffset->setValue( m_internalSettings->buttonHOffset() );
m_ui.hOffset->setValue( m_internalSettings->hOffset() );
m_ui.unisonHovering->setChecked( m_internalSettings->unisonHovering() );
m_ui.cornerRadiusSpinBox->setValue( m_internalSettings->cornerRadius() );
m_ui.drawBorderOnMaximizedWindows->setChecked( m_internalSettings->drawBorderOnMaximizedWindows() );
Expand Down Expand Up @@ -256,7 +256,7 @@ namespace Breeze
else if( m_ui.buttonSize->currentIndex() != m_internalSettings->buttonSize() ) modified = true;
else if( m_ui.buttonSpacing->value() != m_internalSettings->buttonSpacing() ) modified = true;
else if ( m_ui.buttonPadding->value() != m_internalSettings->buttonPadding() ) modified = true;
else if ( m_ui.buttonHOffset->value() != m_internalSettings->buttonHOffset() ) modified = true;
else if ( m_ui.hOffset->value() != m_internalSettings->hOffset() ) modified = true;
else if( m_ui.unisonHovering->isChecked() != m_internalSettings->unisonHovering() ) modified = true;
else if( m_ui.cornerRadiusSpinBox->value() != m_internalSettings->cornerRadius() ) modified = true;
else if( m_ui.drawBorderOnMaximizedWindows->isChecked() != m_internalSettings->drawBorderOnMaximizedWindows() ) modified = true;
Expand Down
10 changes: 5 additions & 5 deletions config/ui/breezeconfigurationui.ui
Original file line number Diff line number Diff line change
Expand Up @@ -171,15 +171,15 @@
</widget>
</item>
<item row="5" column="1" alignment="Qt::AlignLeft">
<widget class="QLabel" name="buttonHOffsetLabel">
<widget class="QLabel" name="hOffsetLabel">
<property name="text">
<string>Button horizontal offset:</string>
<string>Horizontal offset:</string>
</property>
<property name="alignment">
<set>Qt::AlignRight|Qt::AlignTrailing|Qt::AlignVCenter</set>
</property>
<property name="buddy">
<cstring>buttonHOffset</cstring>
<cstring>hOffset</cstring>
</property>
</widget>
</item>
Expand Down Expand Up @@ -401,7 +401,7 @@
</widget>
</item>
<item row="5" column="2">
<widget class="QSpinBox" name="buttonHOffset">
<widget class="QSpinBox" name="hOffset">
<property name="enabled">
<bool>true</bool>
</property>
Expand Down Expand Up @@ -789,7 +789,7 @@
<tabstop>buttonStyle</tabstop>
<tabstop>buttonSpacing</tabstop>
<tabstop>buttonPadding</tabstop>
<tabstop>buttonHOffset</tabstop>
<tabstop>hOffset</tabstop>
<tabstop>hideTitleBar</tabstop>
<tabstop>matchColorForTitleBar</tabstop>
<tabstop>systemForegroundColor</tabstop>
Expand Down

0 comments on commit fb8e165

Please sign in to comment.