Skip to content

Commit

Permalink
More work on widgets (linedit, tabs) and blur support, update README …
Browse files Browse the repository at this point in the history
…and add color scheme
  • Loading branch information
Luwx committed Aug 18, 2020
1 parent 34a2e78 commit d97ce64
Show file tree
Hide file tree
Showing 19 changed files with 815 additions and 205 deletions.
1 change: 1 addition & 0 deletions CMakeLists.txt
Original file line number Diff line number Diff line change
Expand Up @@ -26,6 +26,7 @@ if(WITH_DECORATIONS)
add_subdirectory(kdecoration)
endif()

add_subdirectory(colors)
add_subdirectory(liblightlycommon)
add_subdirectory(kstyle)
add_subdirectory(misc)
Expand Down
11 changes: 10 additions & 1 deletion README.md
Original file line number Diff line number Diff line change
Expand Up @@ -2,7 +2,14 @@
<img src="logo.png"/>
</p>

*Lightly* is a theme style that aims to be visually modern and minimalistic.
*Lightly* is a fork of breeze theme style that aims to be visually modern and minimalistic.

## Development ⚠️

Lightly is a work in progress theme, there is still a lot to change, so expect bugs! Some applications may suddenly crash or flicker.

If you have any feedback or encounter some bugs, feel free to open an issue or a pr.


## Screenshots

Expand Down Expand Up @@ -31,7 +38,9 @@ make
sudo make install
```

## Acknowledgments

Breeze authors and Kvantum developer Pedram Pourang.



Expand Down
Binary file modified Screenshot.png
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
2 changes: 2 additions & 0 deletions colors/CMakeLists.txt
Original file line number Diff line number Diff line change
@@ -0,0 +1,2 @@
install(FILES Lightly.colors
DESTINATION ${DATA_INSTALL_DIR}/color-schemes/)
2 changes: 2 additions & 0 deletions colors/ExtraDesktop.sh
Original file line number Diff line number Diff line change
@@ -0,0 +1,2 @@
#!/bin/sh
find -name \*.colors -print
103 changes: 103 additions & 0 deletions colors/Lightly.colors
Original file line number Diff line number Diff line change
@@ -0,0 +1,103 @@
[ColorEffects:Disabled]
Color=210,205,218
ColorAmount=1
ColorEffect=1
ContrastAmount=0.75
ContrastEffect=1
IntensityAmount=0.45
IntensityEffect=0

[ColorEffects:Inactive]
ChangeSelectionColor=true
Color=0,0,0
ColorAmount=1
ColorEffect=1
ContrastAmount=0.25
ContrastEffect=1
Enable=true
IntensityAmount=0
IntensityEffect=0

[Colors:Button]
BackgroundAlternate=252,252,252
BackgroundNormal=250,250,250
DecorationFocus=71,90,121
DecorationHover=201,226,255
ForegroundActive=0,102,255
ForegroundInactive=150,150,150
ForegroundLink=82,118,217
ForegroundNegative=223,49,49
ForegroundNeutral=236,145,39
ForegroundNormal=16,16,16
ForegroundPositive=34,161,87
ForegroundVisited=139,74,176

[Colors:Selection]
BackgroundAlternate=171,188,248
BackgroundNormal=65,98,148
DecorationFocus=71,90,121
DecorationHover=201,226,255
ForegroundActive=0,102,255
ForegroundInactive=64,64,192
ForegroundLink=82,118,217
ForegroundNegative=223,49,49
ForegroundNeutral=236,145,39
ForegroundNormal=255,255,255
ForegroundPositive=34,161,87
ForegroundVisited=139,74,176

[Colors:Tooltip]
BackgroundAlternate=230,230,230
BackgroundNormal=255,255,255
DecorationFocus=71,90,121
DecorationHover=201,226,255
ForegroundActive=0,102,255
ForegroundInactive=112,112,112
ForegroundLink=82,118,217
ForegroundNegative=223,49,49
ForegroundNeutral=236,145,39
ForegroundNormal=255,255,255
ForegroundPositive=34,161,87
ForegroundVisited=139,74,176

[Colors:View]
BackgroundAlternate=250,250,250
BackgroundNormal=255,255,255
DecorationFocus=71,90,121
DecorationHover=201,226,255
ForegroundActive=0,102,255
ForegroundInactive=112,112,112
ForegroundLink=82,118,217
ForegroundNegative=223,49,49
ForegroundNeutral=236,145,39
ForegroundNormal=16,16,16
ForegroundPositive=34,161,87
ForegroundVisited=139,74,176

[Colors:Window]
BackgroundAlternate=248,248,248
BackgroundNormal=240,240,240
DecorationFocus=71,90,121
DecorationHover=201,226,255
ForegroundActive=0,102,255
ForegroundInactive=112,112,112
ForegroundLink=82,118,217
ForegroundNegative=223,49,49
ForegroundNeutral=236,145,39
ForegroundNormal=48,48,48
ForegroundPositive=34,161,87
ForegroundVisited=139,74,176

[General]
Name=Lightly
shadeSortColumn=true

[KDE]
contrast=10

[WM]
activeBackground=240,240,240,204
activeForeground=48,48,48
inactiveBackground=240,240,240, 204
inactiveBlend=255,255,255
inactiveForeground=96,96,96
2 changes: 1 addition & 1 deletion kdecoration/lightly.json
Original file line number Diff line number Diff line change
Expand Up @@ -93,7 +93,7 @@
]
},
"org.kde.kdecoration2": {
"blur": false,
"blur": true,
"kcmodule": true,
"recommendedBorderSize": "None"
}
Expand Down
2 changes: 1 addition & 1 deletion kdecoration/lightlydecoration.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -774,7 +774,7 @@ namespace Lightly
Metrics::Frame_FrameRadius + 0.5);

// Draw outline.
painter.setPen(withOpacity(g_shadowColor, 0.2 * strength));
painter.setPen(withOpacity(g_shadowColor, 0.4 * strength));
painter.setBrush(Qt::NoBrush);
painter.setCompositionMode(QPainter::CompositionMode_SourceOver);
painter.drawRoundedRect(
Expand Down
16 changes: 16 additions & 0 deletions kstyle/config/lightlystyleconfig.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -61,6 +61,9 @@ namespace Lightly
connect( _scrollBarSubLineButtons, SIGNAL(currentIndexChanged(int)), SLOT(updateChanged()) );
connect( _windowDragMode, SIGNAL(currentIndexChanged(int)), SLOT(updateChanged()) );
connect( _menuOpacity, &QAbstractSlider::valueChanged, this, &StyleConfig::updateChanged );
//connect( _toolBarOpacity, &QAbstractSlider::valueChanged, this, &StyleConfig::updateChanged );
//connect( _kTextEditDrawFrame, &QAbstractButton::toggled, this, &StyleConfig::updateChanged );
//connect( _widgetDrawShadow, &QAbstractButton::toggled, this, &StyleConfig::updateChanged );

}

Expand All @@ -83,6 +86,10 @@ namespace Lightly
StyleConfigData::setAnimationsDuration( _animationsDuration->value() );
StyleConfigData::setWindowDragMode( _windowDragMode->currentIndex() );
StyleConfigData::setMenuOpacity( _menuOpacity->value() );
//StyleConfigData::setToolBarOpacity( _toolBarOpacity->value() );
//StyleConfigData::setKTextEditDrawFrame( _kTextEditDrawFrame->isChecked() );
//StyleConfigData::setWidgetDrawShadow( _widgetDrawShadow->isChecked() );


StyleConfigData::self()->save();

Expand Down Expand Up @@ -131,6 +138,11 @@ namespace Lightly
else if( _animationsDuration->value() != StyleConfigData::animationsDuration() ) modified = true;
else if( _windowDragMode->currentIndex() != StyleConfigData::windowDragMode() ) modified = true;
else if( _menuOpacity->value() != StyleConfigData::menuOpacity() ) modified = true;
//else if( _toolBarOpacity->value() != StyleConfigData::toolBarOpacity() ) modified = true;
//else if( _kTextEditDrawFrame->isChecked() != StyleConfigData::kTextEditDrawFrame() ) modified = true;
//else if( _widgetDrawShadow->isChecked() != StyleConfigData::widgetDrawShadow() ) modified = true;



emit changed(modified);

Expand All @@ -156,6 +168,10 @@ namespace Lightly
_animationsDuration->setValue( StyleConfigData::animationsDuration() );
_windowDragMode->setCurrentIndex( StyleConfigData::windowDragMode() );
_menuOpacity->setValue( StyleConfigData::menuOpacity() );
//_toolBarOpacity->setValue( StyleConfigData::toolBarOpacity() );
//_kTextEditDrawFrame->setChecked( StyleConfigData::kTextEditDrawFrame() );
//_widgetDrawShadow->setChecked( StyleConfigData::widgetDrawShadow() );


}

Expand Down
2 changes: 1 addition & 1 deletion kstyle/config/ui/lightlystyleconfig.ui
Original file line number Diff line number Diff line change
Expand Up @@ -576,4 +576,4 @@
</hints>
</connection>
</connections>
</ui>
</ui>
8 changes: 4 additions & 4 deletions kstyle/lightly.h
Original file line number Diff line number Diff line change
Expand Up @@ -53,7 +53,7 @@ namespace Lightly
Layout_DefaultSpacing = 8,

// line editors
LineEdit_FrameWidth = 6 + Frame_FrameWidth,
LineEdit_FrameWidth = 5 + Frame_FrameWidth,

// menu items
Menu_FrameWidth = 0,
Expand All @@ -64,7 +64,7 @@ namespace Lightly
MenuButton_IndicatorWidth = 20,

// combobox
ComboBox_FrameWidth = 6 + Frame_FrameWidth,
ComboBox_FrameWidth = 5 + Frame_FrameWidth,

// spinbox
SpinBox_FrameWidth = LineEdit_FrameWidth,
Expand Down Expand Up @@ -110,7 +110,7 @@ namespace Lightly

// progressbars
ProgressBar_BusyIndicatorSize = 14,
ProgressBar_Thickness = 6,
ProgressBar_Thickness = 4,
ProgressBar_ItemSpacing = 4,

// mdi title bar
Expand All @@ -119,7 +119,7 @@ namespace Lightly
// sliders
Slider_TickLength = 8,
Slider_TickMarginWidth = 2,
Slider_GrooveThickness = 6,
Slider_GrooveThickness = 4,
Slider_ControlThickness = 20,

// tabbar
Expand Down
23 changes: 20 additions & 3 deletions kstyle/lightly.kcfg
Original file line number Diff line number Diff line change
Expand Up @@ -10,7 +10,7 @@

<!-- shadow -->
<entry name="ShadowStrength" type = "Int">
<default>190</default>
<default>102</default>
<min>25</min>
<max>255</max>
</entry>
Expand All @@ -24,7 +24,7 @@
<choice name="ShadowLarge"/>
<choice name="ShadowVeryLarge"/>
</choices>
<default>ShadowSmall</default>
<default>ShadowMedium</default>
</entry>

<entry name="ShadowColor" type = "Color">
Expand Down Expand Up @@ -90,7 +90,11 @@

<!-- toolbars -->
<entry name="ToolBarDrawItemSeparator" type="Bool">
<default>true</default>
<default>false</default>
</entry>

<entry name="ToolBarDrawSeparator" type="Bool">
<default>false</default>
</entry>

<!-- views -->
Expand All @@ -102,6 +106,11 @@
<entry name="SliderDrawTickMarks" type="Bool">
<default>true</default>
</entry>

<!-- shadows on widgets -->
<entry name="WidgetDrawShadow" type="Bool">
<default>true</default>
</entry>

<!-- tree views -->
<entry name="ViewDrawTreeBranchLines" type="Bool">
Expand All @@ -125,6 +134,10 @@
<entry name="DockWidgetDrawFrame" type="Bool">
<default>true</default>
</entry>

<entry name="KTextEditDrawFrame" type="Bool">
<default>false</default>
</entry>

<entry name="SidePanelDrawFrame" type="Bool">
<default>false</default>
Expand Down Expand Up @@ -189,6 +202,10 @@
<entry name="MenuOpacity" type="Int">
<default>100</default>
</entry>

<entry name="ToolBarOpacity" type="Int">
<default>80</default>
</entry>

</group>

Expand Down
50 changes: 44 additions & 6 deletions kstyle/lightlyblurhelper.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -34,9 +34,11 @@
#include <KWindowEffects>

#include <QEvent>
#include <QMainWindow>
#include <QMenu>
#include <QToolBar>
#include <QVector>

#include <QDebug>
namespace
{

Expand Down Expand Up @@ -117,6 +119,7 @@ namespace Lightly
//___________________________________________________________
bool BlurHelper::eventFilter(QObject* object, QEvent* event)
{

switch (event->type()) {
case QEvent::Hide:
case QEvent::Show:
Expand Down Expand Up @@ -152,15 +155,46 @@ namespace Lightly
if (!wMask.isEmpty() && wMask != QRegion(rect))
return QRegion();

if ((qobject_cast<QMenu*>(widget)
else if ((qobject_cast<QMenu*>(widget)
&& !widget->testAttribute(Qt::WA_X11NetWmWindowTypeMenu)) // not a detached menu
|| widget->inherits("QComboBoxPrivateContainer"))
{
return roundedRegion(rect, Metrics::Frame_FrameRadius, true, true);
}
else
return roundedRegion(rect, Metrics::Frame_FrameRadius, false, true);
}
{
// blur entire window
if( widget->palette().color( QPalette::Window ).alpha() < 255 )
return roundedRegion(rect, Metrics::Frame_FrameRadius, false, true);

// blur only main toolbar and menubar
else if( StyleConfigData::toolBarOpacity() < 100 )
{
QRegion region;

if ( QMainWindow *mw = qobject_cast<QMainWindow*>( widget ) )
{
if ( QWidget *mb = mw->menuWidget() )
{
if (mb->isVisible()) region += mb->rect();
}
}

if( !_sregisteredWidgets.isEmpty() )
{
QSet<const QObject*>::const_iterator i = _sregisteredWidgets.constBegin();
const QToolBar *tb = qobject_cast<const QToolBar*>( *i );

if (tb && tb->isVisible()) region += QRegion( QRect( tb->pos(), tb->rect().size() ) );
}
qDebug() << region;
return region;

}

else return QRegion();
}
}

//___________________________________________________________
void BlurHelper::update(QWidget* widget) const
Expand All @@ -171,8 +205,12 @@ namespace Lightly
*/
if (!(widget->testAttribute(Qt::WA_WState_Created) || widget->internalWinId()))
return;

KWindowEffects::enableBlurBehind(widget->winId(), true, blurRegion(widget));

QRegion region = blurRegion(widget);
if (region.isNull()) return;

KWindowEffects::enableBlurBehind(widget->isWindow() ? widget->winId() : widget->window()->winId(), true, region);
//KWindowEffects::enableBackgroundContrast (widget->isWindow() ? widget->winId() : widget->window()->winId(), true, 1.0, 1.2, 1.3, blurRegion(widget));

// force update
if (widget->isVisible()) {
Expand Down
Loading

0 comments on commit d97ce64

Please sign in to comment.