Compare commits

...

5 Commits

Author SHA1 Message Date
Jacopo De Simoi c2f083c278 Abuse sizeGrip to indicate active window 7 years ago
Jacopo De Simoi 1f05bb97b0 Do not paint the window with the active color 7 years ago
Jacopo De Simoi 4cad1cae23 Make decorations tiny and sharp 7 years ago
Jacopo De Simoi 2d38b87e90 Add solarized cursors 7 years ago
Jacopo De Simoi a09d1667de Remove shadow offset 7 years ago
  1. 6
      cursors/Breeze/build.sh
  2. 390
      cursors/Breeze/src/cursors.svg
  3. 64
      kdecoration/breezedecoration.cpp
  4. 2
      kdecoration/breezesizegrip.h

@ -69,7 +69,7 @@ for CUR in src/config/*.cursor; do
fi
if [ "$DIR2X/$BASENAME.png" -ot $RAWSVG ] ; then
inkscape -i $BASENAME -d 180 -f $RAWSVG -e "$DIR2X/$BASENAME.png" > /dev/null
inkscape -i $BASENAME -d 135 -f $RAWSVG -e "$DIR2X/$BASENAME.png" > /dev/null
fi
done
echo -e "\033[0KGenerating simple cursor pixmaps... DONE"
@ -89,7 +89,7 @@ do
fi
if [ "$DIR2X/progress-$i.png" -ot $RAWSVG ] ; then
inkscape -i progress-$i -d 180 -f $RAWSVG -e "$DIR2X/progress-$i.png" > /dev/null
inkscape -i progress-$i -d 135 -f $RAWSVG -e "$DIR2X/progress-$i.png" > /dev/null
fi
if [ "$DIR1X/wait-$i.png" -ot $RAWSVG ] ; then
@ -101,7 +101,7 @@ do
fi
if [ "$DIR2X/wait-$i.png" -ot $RAWSVG ] ; then
inkscape -i wait-$i -d 180 -f $RAWSVG -e "$DIR2X/wait-$i.png" > /dev/null
inkscape -i wait-$i -d 135 -f $RAWSVG -e "$DIR2X/wait-$i.png" > /dev/null
fi
done
echo -e "\033[0KGenerating animated cursor pixmaps... DONE"

File diff suppressed because it is too large Load Diff

Before

Width:  |  Height:  |  Size: 477 KiB

After

Width:  |  Height:  |  Size: 477 KiB

@ -106,14 +106,20 @@ namespace Breeze
{
auto c = client().data();
if( hideTitleBar() ) return c->color( ColorGroup::Inactive, ColorRole::TitleBar );
else if( m_animation->state() == QPropertyAnimation::Running )
{
return KColorUtils::mix(
c->color( ColorGroup::Inactive, ColorRole::TitleBar ),
c->color( ColorGroup::Active, ColorRole::TitleBar ),
m_opacity );
} else return c->color( c->isActive() ? ColorGroup::Active : ColorGroup::Inactive, ColorRole::TitleBar );
// Always return the title bar color regardless of wheter or
// not the title bar is visible or not.
// if( hideTitleBar() ) return c->color( ColorGroup::Inactive, ColorRole::TitleBar );
//else
// if( m_animation->state() == QPropertyAnimation::Running )
// {
// return KColorUtils::mix(
// c->color( ColorGroup::Inactive, ColorRole::TitleBar ),
// c->color( ColorGroup::Active, ColorRole::TitleBar ),
// m_opacity );
// }
// else
return c->color( c->isActive() ? ColorGroup::Active : ColorGroup::Inactive, ColorRole::TitleBar ); //
}
@ -238,21 +244,24 @@ namespace Breeze
void Decoration::updateSizeGripVisibility()
{
auto c = client().data();
// I am stealing the sizeGrip to indicate that the window is
// active, so it should be visible provided that the client is
// active.
if( m_sizeGrip )
{ m_sizeGrip->setVisible( c->isResizeable() && !isMaximized() && !c->isShaded() ); }
{ m_sizeGrip->setVisible( c->isActive() && !c->isShaded() ); }
}
//________________________________________________________________
int Decoration::borderSize(bool bottom) const
{
const int baseSize = settings()->smallSpacing();
const int baseSize = settings()->smallSpacing()*0.50;
if( m_internalSettings && (m_internalSettings->mask() & BorderSize ) )
{
switch (m_internalSettings->borderSize()) {
case InternalSettings::BorderNone: return 0;
case InternalSettings::BorderNoSides: return bottom ? qMax(4, baseSize) : 0;
case InternalSettings::BorderNoSides: return bottom ? baseSize : 0;
default:
case InternalSettings::BorderTiny: return bottom ? qMax(4, baseSize) : baseSize;
case InternalSettings::BorderTiny: return baseSize;
case InternalSettings::BorderNormal: return baseSize*2;
case InternalSettings::BorderLarge: return baseSize*3;
case InternalSettings::BorderVeryLarge: return baseSize*4;
@ -265,9 +274,9 @@ namespace Breeze
switch (settings()->borderSize()) {
case KDecoration2::BorderSize::None: return 0;
case KDecoration2::BorderSize::NoSides: return bottom ? qMax(4, baseSize) : 0;
case KDecoration2::BorderSize::NoSides: return bottom ? baseSize : 0;
default:
case KDecoration2::BorderSize::Tiny: return bottom ? qMax(4, baseSize) : baseSize;
case KDecoration2::BorderSize::Tiny: return baseSize;
case KDecoration2::BorderSize::Normal: return baseSize*2;
case KDecoration2::BorderSize::Large: return baseSize*3;
case KDecoration2::BorderSize::VeryLarge: return baseSize*4;
@ -296,7 +305,7 @@ namespace Breeze
createShadow();
// size grip
if( hasNoBorders() && m_internalSettings->drawSizeGrip() ) createSizeGrip();
if( m_internalSettings->drawSizeGrip() ) createSizeGrip();
else deleteSizeGrip();
}
@ -447,8 +456,22 @@ namespace Breeze
// clip away the top part
if( !hideTitleBar() ) painter->setClipRect(0, borderTop(), size().width(), size().height() - borderTop(), Qt::IntersectClip);
if( s->isAlphaChannelSupported() ) painter->drawRoundedRect(rect(), Metrics::Frame_FrameRadius, Metrics::Frame_FrameRadius);
else painter->drawRect( rect() );
//if( s->isAlphaChannelSupported() ) painter->drawRoundedRect(rect(), Metrics::Frame_FrameRadius/2, Metrics::Frame_FrameRadius/2);
//else
// // Go sharper; no rounded edges
painter->drawRect( rect() );
if (c->isActive()) {
painter->setPen( c->color( ColorGroup::Active, ColorRole::TitleBar ) );
QPointF p=rect().bottomRight()+QPointF(0.5, 0.5);
// Unfortunately SizeGrip::GripSize is private
const int sizeGripSize = 18; //SizeGrip::GripSize;
QPointF q=p-QPoint(0, sizeGripSize);
QPointF r=p-QPoint(sizeGripSize, 0);
painter->drawLine( p, q );
painter->drawLine( p, r );
}
painter->restore();
}
@ -460,8 +483,8 @@ namespace Breeze
painter->save();
painter->setRenderHint(QPainter::Antialiasing, false);
painter->setBrush( Qt::NoBrush );
painter->setPen( c->isActive() ?
c->color( ColorGroup::Active, ColorRole::TitleBar ):
painter->setPen( //c->isActive() ?
//c->color( ColorGroup::Active, ColorRole::TitleBar ):
c->color( ColorGroup::Inactive, ColorRole::Foreground ) );
painter->drawRect( rect().adjusted( 0, 0, -1, -1 ) );
@ -650,7 +673,7 @@ namespace Breeze
}
// offset
int shadowOffset = (g_shadowSizeEnum == InternalSettings::ShadowNone) ? 0 : qMax( 6*shadowSize/16, Metrics::Shadow_Overlap*2 );
const int shadowOffset = 0; //qMax( 6*g_shadowSize/16, Metrics::Shadow_Overlap*2 );
// create image
QImage image(2*shadowSize, 2*shadowSize, QImage::Format_ARGB32_Premultiplied);
@ -743,6 +766,7 @@ namespace Breeze
connect( c, &KDecoration2::DecoratedClient::maximizedChanged, this, &Decoration::updateSizeGripVisibility );
connect( c, &KDecoration2::DecoratedClient::shadedChanged, this, &Decoration::updateSizeGripVisibility );
connect( c, &KDecoration2::DecoratedClient::resizeableChanged, this, &Decoration::updateSizeGripVisibility );
connect( c, &KDecoration2::DecoratedClient::activeChanged, this, &Decoration::updateSizeGripVisibility );
}
#endif

@ -81,7 +81,7 @@ namespace Breeze
//* grip size
enum {
Offset = 0,
GripSize = 14
GripSize = 18
};
//* decoration

Loading…
Cancel
Save