This is a diff of kde:breeze
at 63207819b89f13bbeeda1ddb3d090495a0e0ea85 with https://github.com/tsujan/BreezeEnhanced at 5006a54ff193e88744553974b9c24a63bc5110f8 pasted onto it.
Created
October 4, 2018 23:30
-
-
Save Zren/448d3d4b6cec273b1bcfae26fcd7f6b7 to your computer and use it in GitHub Desktop.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
diff --git a/kdecoration/CMakeLists.txt b/kdecoration/CMakeLists.txt | |
index e79d728..8d5b080 100644 | |
--- a/kdecoration/CMakeLists.txt | |
+++ b/kdecoration/CMakeLists.txt | |
@@ -1,3 +1,27 @@ | |
+ | |
+project(breezeenhanced) | |
+set(PROJECT_VERSION "0.1") | |
+set(PROJECT_VERSION_MAJOR 0) | |
+ | |
+cmake_minimum_required(VERSION 2.8.12 FATAL_ERROR) | |
+ | |
+include(WriteBasicConfigVersionFile) | |
+include(FeatureSummary) | |
+ | |
+find_package(ECM 0.0.9 REQUIRED NO_MODULE) | |
+ | |
+set(CMAKE_MODULE_PATH ${ECM_MODULE_PATH} ${ECM_KDE_MODULE_DIR} ${CMAKE_SOURCE_DIR}/cmake) | |
+include(ECMInstallIcons) | |
+include(KDEInstallDirs) | |
+include(KDECMakeSettings) | |
+include(KDECompilerSettings NO_POLICY_SCOPE) | |
+include(GenerateExportHeader) | |
+# include(GtkUpdateIconCache) | |
+ | |
+find_package(KDecoration2 REQUIRED) | |
+ | |
+ | |
+# old stuff | |
add_definitions(-DTRANSLATION_DOMAIN="breeze_kwin_deco") | |
find_package(KF5 REQUIRED COMPONENTS CoreAddons GuiAddons ConfigWidgets WindowSystem I18n) | |
@@ -28,24 +52,23 @@ endif() | |
################# configuration ################# | |
configure_file(config-breeze.h.cmake ${CMAKE_CURRENT_BINARY_DIR}/config-breeze.h ) | |
-################# includes ################# | |
-include_directories(${CMAKE_SOURCE_DIR}/libbreezecommon) | |
-include_directories(${CMAKE_BINARY_DIR}/libbreezecommon) | |
- | |
################# newt target ################# | |
### plugin classes | |
-set(breezedecoration_SRCS | |
+# set(breezedecoration_SRCS | |
+set(breezeenhanced_SRCS | |
breezebutton.cpp | |
breezedecoration.cpp | |
breezeexceptionlist.cpp | |
breezesettingsprovider.cpp | |
breezesizegrip.cpp) | |
-kconfig_add_kcfg_files(breezedecoration_SRCS breezesettings.kcfgc) | |
+# kconfig_add_kcfg_files(breezedecoration_SRCS breezesettings.kcfgc) | |
+kconfig_add_kcfg_files(breezeenhanced_SRCS breezesettings.kcfgc) | |
### config classes | |
### they are kept separately because they might move in a separate library in the future | |
-set(breezedecoration_config_SRCS | |
+# set(breezedecoration_config_SRCS | |
+set(breezeenhanced_config_SRCS | |
config/breezeconfigwidget.cpp | |
config/breezedetectwidget.cpp | |
config/breezeexceptiondialog.cpp | |
@@ -54,28 +77,34 @@ set(breezedecoration_config_SRCS | |
config/breezeitemmodel.cpp | |
) | |
-set(breezedecoration_config_PART_FORMS | |
+# set(breezedecoration_config_PART_FORMS | |
+set(breezeenhanced_config_PART_FORMS | |
config/ui/breezeconfigurationui.ui | |
config/ui/breezedetectwidget.ui | |
config/ui/breezeexceptiondialog.ui | |
config/ui/breezeexceptionlistwidget.ui | |
) | |
-ki18n_wrap_ui(breezedecoration_config_PART_FORMS_HEADERS ${breezedecoration_config_PART_FORMS}) | |
+# ki18n_wrap_ui(breezedecoration_config_PART_FORMS_HEADERS ${breezedecoration_config_PART_FORMS}) | |
+ki18n_wrap_ui(breezeenhanced_config_PART_FORMS_HEADERS ${breezeenhanced_config_PART_FORMS}) | |
### build library | |
-add_library(breezedecoration MODULE | |
- ${breezedecoration_SRCS} | |
- ${breezedecoration_config_SRCS} | |
- ${breezedecoration_config_PART_FORMS_HEADERS}) | |
- | |
-target_link_libraries(breezedecoration | |
+# add_library(breezedecoration MODULE | |
+ # ${breezedecoration_SRCS} | |
+ # ${breezedecoration_config_SRCS} | |
+ # ${breezedecoration_config_PART_FORMS_HEADERS}) | |
+add_library(breezeenhanced MODULE | |
+ ${breezeenhanced_SRCS} | |
+ ${breezeenhanced_config_SRCS} | |
+ ${breezeenhanced_config_PART_FORMS_HEADERS}) | |
+ | |
+# target_link_libraries(breezedecoration | |
+target_link_libraries(breezeenhanced | |
PUBLIC | |
Qt5::Core | |
Qt5::Gui | |
Qt5::DBus | |
PRIVATE | |
- breezecommon5 | |
KDecoration2::KDecoration | |
KF5::ConfigCore | |
KF5::CoreAddons | |
@@ -85,12 +114,15 @@ target_link_libraries(breezedecoration | |
KF5::WindowSystem) | |
if(BREEZE_HAVE_X11) | |
- target_link_libraries(breezedecoration | |
+ # target_link_libraries(breezedecoration | |
+ target_link_libraries(breezeenhanced | |
PUBLIC | |
Qt5::X11Extras | |
XCB::XCB) | |
endif() | |
-install(TARGETS breezedecoration DESTINATION ${PLUGIN_INSTALL_DIR}/org.kde.kdecoration2) | |
-install(FILES config/breezedecorationconfig.desktop DESTINATION ${SERVICES_INSTALL_DIR}) | |
+install(TARGETS breezeenhanced DESTINATION ${PLUGIN_INSTALL_DIR}/org.kde.kdecoration2) | |
+install(FILES config/breezeenhancedconfig.desktop DESTINATION ${SERVICES_INSTALL_DIR}) | |
+# install(TARGETS breezedecoration DESTINATION ${PLUGIN_INSTALL_DIR}/org.kde.kdecoration2) | |
+# install(FILES config/breezedecorationconfig.desktop DESTINATION ${SERVICES_INSTALL_DIR}) | |
diff --git a/kdecoration/breeze.json b/kdecoration/breeze.json | |
index ab9ea19..6f3c7b6 100644 | |
--- a/kdecoration/breeze.json | |
+++ b/kdecoration/breeze.json | |
@@ -16,10 +16,8 @@ | |
"Description[gl]": "Decoración de xanelas que usa o estilo visual Breeze para o escritorio Plasma.", | |
"Description[hu]": "A Breeze vizuális stílusát használó ablakdekoráció", | |
"Description[ia]": "Decoration de fenestra usante le stylo visual Breeze (Brisa) per le scriptorio de Plasma", | |
- "Description[id]": "Dekorasi jendela menggunakan gaya visual Breeze untuk Desktop Plasma", | |
"Description[it]": "Decorazione per finestre che usa lo stile visuale di Brezza per il desktop Plasma", | |
"Description[ko]": "Plasma 데스크톱의 Breeze 시각 스타일을 사용하는 창 장식", | |
- "Description[nb]": "Vinduspynt som bruker Breeze-stilen for Plasma-skrivebordet", | |
"Description[nl]": "Vensterdecoratie met gebruik van de visuele stijl Breeze voor het Plasma bureaublad", | |
"Description[nn]": "Vindaugspynt som brukar Breeze-stilen for Plasma-skrivebordet", | |
"Description[pl]": "Wystrój okien przy użyciu stylu wizualnego Bryzy dla Pulpitu Plazmy", | |
@@ -39,8 +37,8 @@ | |
"Description[zh_CN]": "窗口装饰使用等离子桌面微风视觉主题", | |
"Description[zh_TW]": "使用 Plasma 桌面 Breeze 視覺樣式的視窗裝飾", | |
"EnabledByDefault": true, | |
- "Id": "org.kde.breeze", | |
- "Name": "Breeze", | |
+ "Id": "org.kde.breezeenhanced", | |
+ "Name": "BreezeEnhanced", | |
"Name[ar]": "نسيم", | |
"Name[ca@valencia]": "Brisa", | |
"Name[ca]": "Brisa", | |
@@ -64,7 +62,8 @@ | |
] | |
}, | |
"org.kde.kdecoration2": { | |
- "blur": false, | |
+ "blur": true, | |
+ "defaultTheme": "BreezeEnhanced", | |
"kcmodule": true | |
} | |
} | |
diff --git a/kdecoration/breezebutton.cpp b/kdecoration/breezebutton.cpp | |
index 09cd4b0..df3041c 100644 | |
--- a/kdecoration/breezebutton.cpp | |
+++ b/kdecoration/breezebutton.cpp | |
@@ -168,12 +168,6 @@ namespace Breeze | |
// render background | |
const QColor backgroundColor( this->backgroundColor() ); | |
- if( backgroundColor.isValid() ) | |
- { | |
- painter->setPen( Qt::NoPen ); | |
- painter->setBrush( backgroundColor ); | |
- painter->drawEllipse( QRectF( 0, 0, 18, 18 ) ); | |
- } | |
// render mark | |
const QColor foregroundColor( this->foregroundColor() ); | |
@@ -186,53 +180,172 @@ namespace Breeze | |
pen.setJoinStyle( Qt::MiterJoin ); | |
pen.setWidthF( 1.1*qMax((qreal)1.0, 20/width ) ); | |
- painter->setPen( pen ); | |
- painter->setBrush( Qt::NoBrush ); | |
+ auto d = qobject_cast<Decoration*>( decoration() ); | |
switch( type() ) | |
{ | |
case DecorationButtonType::Close: | |
{ | |
- painter->drawLine( QPointF( 5, 5 ), QPointF( 13, 13 ) ); | |
- painter->drawLine( 13, 5, 5, 13 ); | |
+ if (!d || d->internalSettings()->macOSButtons()) { | |
+ int a = (d && !d->client().data()->isActive()) | |
+ ? qRound(200.0 * (1.0 - m_animation->currentValue().toReal())) | |
+ : 255; | |
+ QLinearGradient grad(QPointF(9, 2), QPointF(9, 16)); | |
+ if (d && qGray(d->titleBarColor().rgb()) > 100) | |
+ { | |
+ grad.setColorAt(0, QColor(255, 92, 87, a)); | |
+ grad.setColorAt(1, QColor(233, 84, 79, a)); | |
+ } | |
+ else | |
+ { | |
+ grad.setColorAt(0, QColor(250, 100, 102, a)); | |
+ grad.setColorAt(1, QColor(230, 92, 94, a)); | |
+ } | |
+ painter->setBrush( QBrush(grad) ); | |
+ painter->setPen( Qt::NoPen ); | |
+ painter->drawEllipse( QRectF( 2, 2, 14, 14 ) ); | |
+ if( backgroundColor.isValid() ) | |
+ { | |
+ painter->setPen( Qt::NoPen ); | |
+ painter->setBrush( backgroundColor ); | |
+ qreal r = static_cast<qreal>(7) | |
+ + (isPressed() ? 0.0 | |
+ : static_cast<qreal>(2) * m_animation->currentValue().toReal()); | |
+ QPointF c(static_cast<qreal>(9), static_cast<qreal>(9)); | |
+ painter->drawEllipse( c, r, r ); | |
+ } | |
+ } | |
+ else { | |
+ if( backgroundColor.isValid() ) | |
+ { | |
+ painter->setPen( Qt::NoPen ); | |
+ painter->setBrush( backgroundColor ); | |
+ painter->drawEllipse( QRectF( 0, 0, 18, 18 ) ); | |
+ } | |
+ painter->setPen( pen ); | |
+ painter->setBrush( Qt::NoBrush ); | |
+ | |
+ painter->drawLine( QPointF( 6, 6 ), QPointF( 12, 12 ) ); | |
+ painter->drawLine( QPointF( 6, 12 ), QPointF( 12, 6 ) ); | |
+ } | |
break; | |
} | |
case DecorationButtonType::Maximize: | |
{ | |
- if( isChecked() ) | |
- { | |
- pen.setJoinStyle( Qt::RoundJoin ); | |
+ if (!d || d->internalSettings()->macOSButtons()) { | |
+ int a = (d && !d->client().data()->isActive()) | |
+ ? qRound(200.0 * (1.0 - m_animation->currentValue().toReal())) | |
+ : 255; | |
+ QLinearGradient grad(QPointF(9, 2), QPointF(9, 16)); | |
+ if (d && qGray(d->titleBarColor().rgb()) > 100) | |
+ { | |
+ grad.setColorAt(0, isChecked() ? QColor(67, 198, 176, a) | |
+ : QColor(40, 211, 63, a)); | |
+ grad.setColorAt(1, isChecked() ? QColor(60, 178, 159, a) | |
+ : QColor(36, 191, 57, a)); | |
+ } | |
+ else | |
+ { | |
+ grad.setColorAt(0, isChecked() ? QColor(67, 198, 176, a) | |
+ : QColor(124, 198, 67, a)); | |
+ grad.setColorAt(1, isChecked() ? QColor(60, 178, 159, a) | |
+ : QColor(111, 178, 60, a)); | |
+ } | |
+ painter->setBrush( QBrush(grad) ); | |
+ painter->setPen( Qt::NoPen ); | |
+ painter->drawEllipse( QRectF( 2, 2, 14, 14 ) ); | |
+ if( backgroundColor.isValid() ) | |
+ { | |
+ painter->setPen( Qt::NoPen ); | |
+ painter->setBrush( backgroundColor ); | |
+ qreal r = static_cast<qreal>(7) | |
+ + (isPressed() ? 0.0 | |
+ : static_cast<qreal>(2) * m_animation->currentValue().toReal()); | |
+ QPointF c(static_cast<qreal>(9), static_cast<qreal>(9)); | |
+ painter->drawEllipse( c, r, r ); | |
+ } | |
+ } | |
+ else { | |
+ if( backgroundColor.isValid() ) | |
+ { | |
+ painter->setPen( Qt::NoPen ); | |
+ painter->setBrush( backgroundColor ); | |
+ painter->drawEllipse( QRectF( 0, 0, 18, 18 ) ); | |
+ } | |
painter->setPen( pen ); | |
+ painter->setBrush( Qt::NoBrush ); | |
- painter->drawPolygon( QVector<QPointF>{ | |
- QPointF( 4, 9 ), | |
- QPointF( 9, 4 ), | |
- QPointF( 14, 9 ), | |
- QPointF( 9, 14 )} ); | |
- | |
- } else { | |
- painter->drawPolyline( QVector<QPointF>{ | |
- QPointF( 4, 11 ), | |
- QPointF( 9, 6 ), | |
- QPointF( 14, 11 )}); | |
+ if (isChecked()) { | |
+ painter->drawPolyline(QPolygonF() | |
+ << QPointF(6, 7) << QPointF(6, 12) << QPointF(11, 12)); | |
+ painter->drawLine(QPointF(7, 11), QPointF(12, 6)); | |
+ } | |
+ else { | |
+ painter->drawPolyline(QPolygonF() | |
+ << QPointF(5, 8) << QPointF(5, 13) << QPointF(10, 13)); | |
+ painter->drawPolyline(QPolygonF() | |
+ << QPointF(8, 5) << QPointF(13, 5) << QPointF(13, 10)); | |
+ } | |
} | |
break; | |
} | |
case DecorationButtonType::Minimize: | |
{ | |
- painter->drawPolyline( QVector<QPointF>{ | |
- QPointF( 4, 7 ), | |
- QPointF( 9, 12 ), | |
- QPointF( 14, 7 ) }); | |
+ if (!d || d->internalSettings()->macOSButtons()) { | |
+ int a = (d && !d->client().data()->isActive()) | |
+ ? qRound(200.0 * (1.0 - m_animation->currentValue().toReal())) | |
+ : 255; | |
+ QLinearGradient grad(QPointF(9, 2), QPointF(9, 16)); | |
+ if (d && qGray(d->titleBarColor().rgb()) > 100) | |
+ { // yellow isn't good with light backgrounds | |
+ grad.setColorAt(0, QColor(243, 176, 43, a)); | |
+ grad.setColorAt(1, QColor(223, 162, 39, a)); | |
+ } | |
+ else | |
+ { | |
+ grad.setColorAt(0, QColor(237, 198, 81, a)); | |
+ grad.setColorAt(1, QColor(217, 181, 74, a)); | |
+ } | |
+ painter->setBrush( QBrush(grad) ); | |
+ painter->setPen( Qt::NoPen ); | |
+ painter->drawEllipse( QRectF( 2, 2, 14, 14 ) ); | |
+ if( backgroundColor.isValid() ) | |
+ { | |
+ painter->setPen( Qt::NoPen ); | |
+ painter->setBrush( backgroundColor ); | |
+ qreal r = static_cast<qreal>(7) | |
+ + (isPressed() ? 0.0 | |
+ : static_cast<qreal>(2) * m_animation->currentValue().toReal()); | |
+ QPointF c(static_cast<qreal>(9), static_cast<qreal>(9)); | |
+ painter->drawEllipse( c, r, r ); | |
+ } | |
+ } | |
+ else { | |
+ if( backgroundColor.isValid() ) | |
+ { | |
+ painter->setPen( Qt::NoPen ); | |
+ painter->setBrush( backgroundColor ); | |
+ painter->drawEllipse( QRectF( 0, 0, 18, 18 ) ); | |
+ } | |
+ painter->setPen( pen ); | |
+ painter->setBrush( Qt::NoBrush ); | |
+ | |
+ painter->drawLine( QPointF( 5, 9 ), QPointF( 13, 9 ) ); | |
+ } | |
break; | |
} | |
case DecorationButtonType::OnAllDesktops: | |
{ | |
painter->setPen( Qt::NoPen ); | |
+ if( backgroundColor.isValid() ) | |
+ { | |
+ painter->setBrush( backgroundColor ); | |
+ painter->drawEllipse( QRectF( 0, 0, 18, 18 ) ); | |
+ } | |
painter->setBrush( foregroundColor ); | |
if( isChecked()) | |
@@ -243,7 +356,6 @@ namespace Breeze | |
// center dot | |
QColor backgroundColor( this->backgroundColor() ); | |
- auto d = qobject_cast<Decoration*>( decoration() ); | |
if( !backgroundColor.isValid() && d ) backgroundColor = d->titleBarColor(); | |
if( backgroundColor.isValid() ) | |
@@ -254,11 +366,11 @@ namespace Breeze | |
} else { | |
- painter->drawPolygon( QVector<QPointF> { | |
- QPointF( 6.5, 8.5 ), | |
- QPointF( 12, 3 ), | |
- QPointF( 15, 6 ), | |
- QPointF( 9.5, 11.5 )} ); | |
+ painter->drawPolygon( QPolygonF() | |
+ << QPointF( 6.5, 8.5 ) | |
+ << QPointF( 12, 3 ) | |
+ << QPointF( 15, 6 ) | |
+ << QPointF( 9.5, 11.5 ) ); | |
painter->setPen( pen ); | |
painter->drawLine( QPointF( 5.5, 7.5 ), QPointF( 10.5, 12.5 ) ); | |
@@ -269,23 +381,39 @@ namespace Breeze | |
case DecorationButtonType::Shade: | |
{ | |
+ if( backgroundColor.isValid() ) | |
+ { | |
+ painter->setPen( Qt::NoPen ); | |
+ painter->setBrush( backgroundColor ); | |
+ painter->drawEllipse( QRectF( 0, 0, 18, 18 ) ); | |
+ } | |
+ painter->setPen( pen ); | |
+ painter->setBrush( Qt::NoBrush ); | |
if (isChecked()) | |
{ | |
painter->drawLine( 4, 5, 14, 5 ); | |
- painter->drawPolyline( QVector<QPointF> { | |
- QPointF( 4, 8 ), | |
- QPointF( 9, 13 ), | |
- QPointF( 14, 8 )} ); | |
+ painter->drawPolyline( QPolygonF() | |
+ << QPointF( 4, 8 ) | |
+ << QPointF( 9, 13 ) | |
+ << QPointF( 14, 8 ) ); | |
} else { | |
- | |
- painter->drawLine( 4, 5, 14, 5 ); | |
- painter->drawPolyline( QVector<QPointF> { | |
- QPointF( 4, 13 ), | |
- QPointF( 9, 8 ), | |
- QPointF( 14, 13 ) }); | |
+ if (!d || d->internalSettings()->macOSButtons()) { | |
+ painter->drawLine( 4, 5, 14, 5 ); | |
+ painter->drawPolyline( QPolygonF() | |
+ << QPointF( 4, 13 ) | |
+ << QPointF( 9, 8 ) | |
+ << QPointF( 14, 13 ) ); | |
+ } | |
+ else { // make it smaller | |
+ painter->drawLine( 5, 5, 13, 5 ); | |
+ painter->drawPolyline( QPolygonF() | |
+ << QPointF( 5, 12 ) | |
+ << QPointF( 9, 8 ) | |
+ << QPointF( 13, 12 ) ); | |
+ } | |
} | |
break; | |
@@ -294,37 +422,89 @@ namespace Breeze | |
case DecorationButtonType::KeepBelow: | |
{ | |
- | |
- painter->drawPolyline( QVector<QPointF> { | |
- QPointF( 4, 5 ), | |
- QPointF( 9, 10 ), | |
- QPointF( 14, 5 ) }); | |
- | |
- painter->drawPolyline( QVector<QPointF> { | |
- QPointF( 4, 9 ), | |
- QPointF( 9, 14 ), | |
- QPointF( 14, 9 ) }); | |
+ if( backgroundColor.isValid() ) | |
+ { | |
+ painter->setPen( Qt::NoPen ); | |
+ painter->setBrush( backgroundColor ); | |
+ painter->drawEllipse( QRectF( 0, 0, 18, 18 ) ); | |
+ } | |
+ painter->setPen( pen ); | |
+ painter->setBrush( Qt::NoBrush ); | |
+ | |
+ if (!d || d->internalSettings()->macOSButtons()) { | |
+ painter->drawPolyline( QPolygonF() | |
+ << QPointF( 4, 5 ) | |
+ << QPointF( 9, 10 ) | |
+ << QPointF( 14, 5 ) ); | |
+ | |
+ painter->drawPolyline( QPolygonF() | |
+ << QPointF( 4, 9 ) | |
+ << QPointF( 9, 14 ) | |
+ << QPointF( 14, 9 ) ); | |
+ } | |
+ else { // make it smaller | |
+ painter->drawPolyline( QPolygonF() | |
+ << QPointF( 5, 5 ) | |
+ << QPointF( 9, 9 ) | |
+ << QPointF( 13, 5 ) ); | |
+ | |
+ painter->drawPolyline( QPolygonF() | |
+ << QPointF( 5, 9 ) | |
+ << QPointF( 9, 13 ) | |
+ << QPointF( 13, 9 ) ); | |
+ } | |
break; | |
} | |
case DecorationButtonType::KeepAbove: | |
{ | |
- painter->drawPolyline( QVector<QPointF> { | |
- QPointF( 4, 9 ), | |
- QPointF( 9, 4 ), | |
- QPointF( 14, 9 ) }); | |
- | |
- painter->drawPolyline( QVector<QPointF> { | |
- QPointF( 4, 13 ), | |
- QPointF( 9, 8 ), | |
- QPointF( 14, 13 ) }); | |
+ if( backgroundColor.isValid() ) | |
+ { | |
+ painter->setPen( Qt::NoPen ); | |
+ painter->setBrush( backgroundColor ); | |
+ painter->drawEllipse( QRectF( 0, 0, 18, 18 ) ); | |
+ } | |
+ painter->setPen( pen ); | |
+ painter->setBrush( Qt::NoBrush ); | |
+ | |
+ if (!d || d->internalSettings()->macOSButtons()) { | |
+ painter->drawPolyline( QPolygonF() | |
+ << QPointF( 4, 9 ) | |
+ << QPointF( 9, 4 ) | |
+ << QPointF( 14, 9 ) ); | |
+ | |
+ painter->drawPolyline( QPolygonF() | |
+ << QPointF( 4, 13 ) | |
+ << QPointF( 9, 8 ) | |
+ << QPointF( 14, 13 ) ); | |
+ } | |
+ else { // make it smaller | |
+ painter->drawPolyline( QPolygonF() | |
+ << QPointF( 5, 9 ) | |
+ << QPointF( 9, 5 ) | |
+ << QPointF( 13, 9 ) ); | |
+ | |
+ painter->drawPolyline( QPolygonF() | |
+ << QPointF( 5, 13 ) | |
+ << QPointF( 9, 9 ) | |
+ << QPointF( 13, 13 ) ); | |
+ } | |
break; | |
} | |
case DecorationButtonType::ApplicationMenu: | |
{ | |
+ if( backgroundColor.isValid() ) | |
+ { | |
+ painter->setPen( Qt::NoPen ); | |
+ painter->setBrush( backgroundColor ); | |
+ painter->drawEllipse( QRectF( 0, 0, 18, 18 ) ); | |
+ } | |
+ painter->setPen( pen ); | |
+ painter->setBrush( Qt::NoBrush ); | |
+ | |
painter->drawLine( QPointF( 3.5, 5 ), QPointF( 14.5, 5 ) ); | |
painter->drawLine( QPointF( 3.5, 9 ), QPointF( 14.5, 9 ) ); | |
painter->drawLine( QPointF( 3.5, 13 ), QPointF( 14.5, 13 ) ); | |
@@ -333,6 +513,15 @@ namespace Breeze | |
case DecorationButtonType::ContextHelp: | |
{ | |
+ if( backgroundColor.isValid() ) | |
+ { | |
+ painter->setPen( Qt::NoPen ); | |
+ painter->setBrush( backgroundColor ); | |
+ painter->drawEllipse( QRectF( 0, 0, 18, 18 ) ); | |
+ } | |
+ painter->setPen( pen ); | |
+ painter->setBrush( Qt::NoBrush ); | |
+ | |
QPainterPath path; | |
path.moveTo( 5, 6 ); | |
path.arcTo( QRectF( 5, 3.5, 8, 5 ), 180, -180 ); | |
@@ -368,7 +557,7 @@ namespace Breeze | |
return d->titleBarColor(); | |
- } else if( ( type() == DecorationButtonType::KeepBelow || type() == DecorationButtonType::KeepAbove || type() == DecorationButtonType::Shade ) && isChecked() ) { | |
+ } else if( ( type() == DecorationButtonType::KeepBelow || type() == DecorationButtonType::KeepAbove ) && isChecked() ) { | |
return d->titleBarColor(); | |
@@ -398,54 +587,168 @@ namespace Breeze | |
} | |
- auto c = d->client().data(); | |
- if( isPressed() ) { | |
+ if (d->internalSettings()->macOSButtons()) { | |
+ if( isPressed() ) { | |
- if( type() == DecorationButtonType::Close ) return c->color( ColorGroup::Warning, ColorRole::Foreground ); | |
- else return KColorUtils::mix( d->titleBarColor(), d->fontColor(), 0.3 ); | |
+ QColor col; | |
+ if( type() == DecorationButtonType::Close ) | |
+ { | |
+ if (qGray(d->titleBarColor().rgb()) > 100) | |
+ col = QColor(254, 73, 66); | |
+ else | |
+ col = QColor(240, 77, 80); | |
+ } | |
+ else if( type() == DecorationButtonType::Maximize) | |
+ { | |
+ if (qGray(d->titleBarColor().rgb()) > 100) | |
+ col = isChecked() ? QColor(0, 188, 154) : QColor(7, 201, 33); | |
+ else | |
+ col = isChecked() ? QColor(0, 188, 154) : QColor(101, 188, 34); | |
+ } | |
+ else if( type() == DecorationButtonType::Minimize ) | |
+ { | |
+ if (qGray(d->titleBarColor().rgb()) > 100) | |
+ col = QColor(233, 160, 13); | |
+ else | |
+ col = QColor(227, 185, 59); | |
+ } | |
+ if (col.isValid()) { | |
+ if (!d->client().data()->isActive()) col.setAlpha(200); | |
+ return col; | |
+ } | |
+ else return KColorUtils::mix( d->titleBarColor(), d->fontColor(), 0.3 ); | |
- } else if( ( type() == DecorationButtonType::KeepBelow || type() == DecorationButtonType::KeepAbove || type() == DecorationButtonType::Shade ) && isChecked() ) { | |
+ } else if( ( type() == DecorationButtonType::KeepBelow || type() == DecorationButtonType::KeepAbove ) && isChecked() ) { | |
- return d->fontColor(); | |
+ return d->fontColor(); | |
- } else if( m_animation->state() == QPropertyAnimation::Running ) { | |
+ } else if( m_animation->state() == QPropertyAnimation::Running ) { | |
- if( type() == DecorationButtonType::Close ) | |
- { | |
- if( d->internalSettings()->outlineCloseButton() ) | |
+ QColor col; | |
+ if( type() == DecorationButtonType::Close ) | |
+ { | |
+ if (qGray(d->titleBarColor().rgb()) > 100) | |
+ col = QColor(254, 95, 87); | |
+ else | |
+ col = QColor(240, 96, 97); | |
+ } | |
+ else if( type() == DecorationButtonType::Maximize) | |
{ | |
+ if (qGray(d->titleBarColor().rgb()) > 100) | |
+ col = isChecked() ? QColor(64, 188, 168) : QColor(39, 201, 63); | |
+ else | |
+ col = isChecked() ? QColor(64, 188, 168) : QColor(116, 188, 64); | |
+ } | |
+ else if( type() == DecorationButtonType::Minimize ) | |
+ { | |
+ if (qGray(d->titleBarColor().rgb()) > 100) | |
+ col = QColor(233, 172, 41); | |
+ else | |
+ col = QColor(227, 191, 78); | |
+ } | |
+ if (col.isValid()) { | |
+ if (!d->client().data()->isActive()) col.setAlpha(200); | |
+ return col; | |
+ } else { | |
- return KColorUtils::mix( d->fontColor(), c->color( ColorGroup::Warning, ColorRole::Foreground ).lighter(), m_opacity ); | |
+ col = d->fontColor(); | |
+ col.setAlpha( col.alpha()*m_opacity ); | |
+ return col; | |
- } else { | |
+ } | |
- QColor color( c->color( ColorGroup::Warning, ColorRole::Foreground ).lighter() ); | |
- color.setAlpha( color.alpha()*m_opacity ); | |
- return color; | |
+ } else if( isHovered() ) { | |
+ QColor col; | |
+ if( type() == DecorationButtonType::Close ) | |
+ { | |
+ if (qGray(d->titleBarColor().rgb()) > 100) | |
+ col = QColor(254, 95, 87); | |
+ else | |
+ col = QColor(240, 96, 97); | |
+ } | |
+ else if( type() == DecorationButtonType::Maximize) | |
+ { | |
+ if (qGray(d->titleBarColor().rgb()) > 100) | |
+ col = isChecked() ? QColor(64, 188, 168) : QColor(39, 201, 63); | |
+ else | |
+ col = isChecked() ? QColor(64, 188, 168) : QColor(116, 188, 64); | |
} | |
+ else if( type() == DecorationButtonType::Minimize ) | |
+ { | |
+ if (qGray(d->titleBarColor().rgb()) > 100) | |
+ col = QColor(233, 172, 41); | |
+ else | |
+ col = QColor(227, 191, 78); | |
+ } | |
+ if (col.isValid()) { | |
+ if (!d->client().data()->isActive()) col.setAlpha(200); | |
+ return col; | |
+ } | |
+ else return d->fontColor(); | |
+ | |
+ } else if( type() == DecorationButtonType::Close && d->internalSettings()->outlineCloseButton() ) { | |
+ | |
+ QColor col(240, 96, 97); | |
+ if (!d->client().data()->isActive()) col.setAlpha(200); | |
+ return col; | |
} else { | |
- QColor color( d->fontColor() ); | |
- color.setAlpha( color.alpha()*m_opacity ); | |
- return color; | |
+ return QColor(); | |
} | |
+ } | |
+ else { // as in Breeze | |
+ auto c = d->client().data(); | |
+ if( isPressed() ) { | |
- } else if( isHovered() ) { | |
+ if( type() == DecorationButtonType::Close ) return c->color( ColorGroup::Warning, ColorRole::Foreground ); | |
+ else return KColorUtils::mix( d->titleBarColor(), d->fontColor(), 0.3 ); | |
- if( type() == DecorationButtonType::Close ) return c->color( ColorGroup::Warning, ColorRole::Foreground ).lighter(); | |
- else return d->fontColor(); | |
+ } else if( ( type() == DecorationButtonType::KeepBelow || type() == DecorationButtonType::KeepAbove ) && isChecked() ) { | |
- } else if( type() == DecorationButtonType::Close && d->internalSettings()->outlineCloseButton() ) { | |
+ return d->fontColor(); | |
- return d->fontColor(); | |
+ } else if( m_animation->state() == QPropertyAnimation::Running ) { | |
- } else { | |
+ if( type() == DecorationButtonType::Close ) | |
+ { | |
+ if( d->internalSettings()->outlineCloseButton() ) | |
+ { | |
- return QColor(); | |
+ return KColorUtils::mix( d->fontColor(), c->color( ColorGroup::Warning, ColorRole::Foreground ).lighter(), m_opacity ); | |
+ | |
+ } else { | |
+ | |
+ QColor color( c->color( ColorGroup::Warning, ColorRole::Foreground ).lighter() ); | |
+ color.setAlpha( color.alpha()*m_opacity ); | |
+ return color; | |
+ | |
+ } | |
+ | |
+ } else { | |
+ | |
+ QColor color( d->fontColor() ); | |
+ color.setAlpha( color.alpha()*m_opacity ); | |
+ return color; | |
+ | |
+ } | |
+ } else if( isHovered() ) { | |
+ | |
+ if( type() == DecorationButtonType::Close ) return c->color( ColorGroup::Warning, ColorRole::Foreground ).lighter(); | |
+ else return d->fontColor(); | |
+ | |
+ } else if( type() == DecorationButtonType::Close && d->internalSettings()->outlineCloseButton() ) { | |
+ | |
+ return d->fontColor(); | |
+ | |
+ } else { | |
+ | |
+ return QColor(); | |
+ | |
+ } | |
} | |
} | |
@@ -467,7 +770,10 @@ namespace Breeze | |
auto d = qobject_cast<Decoration*>(decoration()); | |
if( !(d && d->internalSettings()->animationsEnabled() ) ) return; | |
- m_animation->setDirection( hovered ? QPropertyAnimation::Forward : QPropertyAnimation::Backward ); | |
+ QAbstractAnimation::Direction dir = hovered ? QPropertyAnimation::Forward : QPropertyAnimation::Backward; | |
+ if( m_animation->state() == QPropertyAnimation::Running && m_animation->direction() != dir ) | |
+ m_animation->stop(); | |
+ m_animation->setDirection( dir ); | |
if( m_animation->state() != QPropertyAnimation::Running ) m_animation->start(); | |
} | |
diff --git a/kdecoration/breezedecoration.cpp b/kdecoration/breezedecoration.cpp | |
index e3f89df..cea0319 100644 | |
--- a/kdecoration/breezedecoration.cpp | |
+++ b/kdecoration/breezedecoration.cpp | |
@@ -29,8 +29,6 @@ | |
#include "breezebutton.h" | |
#include "breezesizegrip.h" | |
-#include "breezeboxshadowhelper.h" | |
- | |
#include <KDecoration2/DecoratedClient> | |
#include <KDecoration2/DecorationButtonGroup> | |
#include <KDecoration2/DecorationSettings> | |
@@ -59,89 +57,6 @@ K_PLUGIN_FACTORY_WITH_JSON( | |
registerPlugin<Breeze::ConfigWidget>(QStringLiteral("kcmodule")); | |
) | |
-namespace | |
-{ | |
- struct ShadowParams { | |
- ShadowParams() | |
- : offset(QPoint(0, 0)) | |
- , radius(0) | |
- , opacity(0) {} | |
- | |
- ShadowParams(const QPoint &offset, int radius, qreal opacity) | |
- : offset(offset) | |
- , radius(radius) | |
- , opacity(opacity) {} | |
- | |
- QPoint offset; | |
- int radius; | |
- qreal opacity; | |
- }; | |
- | |
- struct CompositeShadowParams { | |
- CompositeShadowParams() = default; | |
- | |
- CompositeShadowParams( | |
- const QPoint &offset, | |
- const ShadowParams &shadow1, | |
- const ShadowParams &shadow2) | |
- : offset(offset) | |
- , shadow1(shadow1) | |
- , shadow2(shadow2) {} | |
- | |
- bool isNone() const { | |
- return qMax(shadow1.radius, shadow2.radius) == 0; | |
- } | |
- | |
- QPoint offset; | |
- ShadowParams shadow1; | |
- ShadowParams shadow2; | |
- }; | |
- | |
- const CompositeShadowParams s_shadowParams[] = { | |
- // None | |
- CompositeShadowParams(), | |
- // Small | |
- CompositeShadowParams( | |
- QPoint(0, 4), | |
- ShadowParams(QPoint(0, 0), 16, 0.6), | |
- ShadowParams(QPoint(0, -2), 4, 0.14)), | |
- // Medium | |
- CompositeShadowParams( | |
- QPoint(0, 8), | |
- ShadowParams(QPoint(0, 0), 32, 0.7), | |
- ShadowParams(QPoint(0, -5), 14, 0.12)), | |
- // Large | |
- CompositeShadowParams( | |
- QPoint(0, 18), | |
- ShadowParams(QPoint(0, 0), 64, 0.8), | |
- ShadowParams(QPoint(0, -10), 24, 0.1)), | |
- // Very large | |
- CompositeShadowParams( | |
- QPoint(0, 26), | |
- ShadowParams(QPoint(0, 0), 96, 0.95), | |
- ShadowParams(QPoint(0, -12), 28, 0.1)) | |
- }; | |
- | |
- inline CompositeShadowParams lookupShadowParams(int size) | |
- { | |
- switch (size) { | |
- case Breeze::InternalSettings::ShadowNone: | |
- return s_shadowParams[0]; | |
- case Breeze::InternalSettings::ShadowSmall: | |
- return s_shadowParams[1]; | |
- case Breeze::InternalSettings::ShadowMedium: | |
- return s_shadowParams[2]; | |
- case Breeze::InternalSettings::ShadowLarge: | |
- return s_shadowParams[3]; | |
- case Breeze::InternalSettings::ShadowVeryLarge: | |
- return s_shadowParams[4]; | |
- default: | |
- // Fallback to the Large size. | |
- return s_shadowParams[3]; | |
- } | |
- } | |
-} | |
- | |
namespace Breeze | |
{ | |
@@ -151,7 +66,7 @@ namespace Breeze | |
//________________________________________________________________ | |
static int g_sDecoCount = 0; | |
static int g_shadowSizeEnum = InternalSettings::ShadowLarge; | |
- static int g_shadowStrength = 255; | |
+ static int g_shadowStrength = 90; | |
static QColor g_shadowColor = Qt::black; | |
static QSharedPointer<KDecoration2::DecorationShadow> g_sShadow; | |
@@ -250,7 +165,7 @@ namespace Breeze | |
connect(s.data(), &KDecoration2::DecorationSettings::borderSizeChanged, this, &Decoration::recalculateBorders); | |
// a change in font might cause the borders to change | |
- connect(s.data(), &KDecoration2::DecorationSettings::fontChanged, this, &Decoration::recalculateBorders); | |
+ recalculateBorders(); | |
connect(s.data(), &KDecoration2::DecorationSettings::spacingChanged, this, &Decoration::recalculateBorders); | |
// buttons | |
@@ -278,7 +193,7 @@ namespace Breeze | |
connect(c, &KDecoration2::DecoratedClient::activeChanged, this, &Decoration::updateAnimationState); | |
connect(c, &KDecoration2::DecoratedClient::widthChanged, this, &Decoration::updateTitleBar); | |
connect(c, &KDecoration2::DecoratedClient::maximizedChanged, this, &Decoration::updateTitleBar); | |
- connect(c, &KDecoration2::DecoratedClient::maximizedChanged, this, &Decoration::setOpaque); | |
+ //connect(c, &KDecoration2::DecoratedClient::maximizedChanged, this, &Decoration::setOpaque); | |
connect(c, &KDecoration2::DecoratedClient::widthChanged, this, &Decoration::updateButtonsGeometry); | |
connect(c, &KDecoration2::DecoratedClient::maximizedChanged, this, &Decoration::updateButtonsGeometry); | |
@@ -384,6 +299,7 @@ namespace Breeze | |
if( hasNoBorders() && m_internalSettings->drawSizeGrip() ) createSizeGrip(); | |
else deleteSizeGrip(); | |
+ m_opacityValue = m_internalSettings->backgroundOpacity() * 2.55; | |
} | |
//________________________________________________________________ | |
@@ -401,7 +317,8 @@ namespace Breeze | |
if( hideTitleBar() ) top = bottom; | |
else { | |
- QFontMetrics fm(s->font()); | |
+ QFont f; f.fromString(m_internalSettings->titleBarFont()); | |
+ QFontMetrics fm(f); | |
top += qMax(fm.height(), buttonHeight() ); | |
// padding below | |
@@ -527,13 +444,22 @@ namespace Breeze | |
painter->save(); | |
painter->setRenderHint(QPainter::Antialiasing); | |
painter->setPen(Qt::NoPen); | |
- painter->setBrush( c->color( c->isActive() ? ColorGroup::Active : ColorGroup::Inactive, ColorRole::Frame ) ); | |
+ | |
+ if (m_windowColor.rgb() != this->titleBarColor().rgb() ) { | |
+ m_windowColor = this->titleBarColor(); | |
+ m_windowColor.setAlpha( m_opacityValue ); | |
+ } | |
+ | |
+ painter->setBrush( m_windowColor ); | |
// 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, Metrics::Frame_FrameRadius); | |
+ } else { | |
+ painter->drawRect( rect() ); | |
+ } | |
painter->restore(); | |
} | |
@@ -566,19 +492,37 @@ namespace Breeze | |
painter->save(); | |
painter->setPen(Qt::NoPen); | |
- // render a linear gradient on title area | |
- if( c->isActive() && m_internalSettings->drawBackgroundGradient() ) | |
+ // render a linear gradient on title area and draw a light border at the top | |
+ if( m_internalSettings->drawBackgroundGradient() && !flatTitleBar() ) | |
{ | |
- const QColor titleBarColor( this->titleBarColor() ); | |
+ QColor titleBarColor( this->titleBarColor() ); | |
+ if( !opaqueTitleBar() ) | |
+ titleBarColor.setAlpha( qRound((qreal)m_internalSettings->backgroundOpacity() * (qreal)2.55) ); | |
+ | |
QLinearGradient gradient( 0, 0, 0, titleRect.height() ); | |
- gradient.setColorAt(0.0, titleBarColor.lighter( 120 ) ); | |
- gradient.setColorAt(0.8, titleBarColor); | |
+ QColor lightCol( titleBarColor.lighter( 130 + m_internalSettings->backgroundGradientIntensity() ) ); | |
+ gradient.setColorAt(0.0, lightCol ); | |
+ gradient.setColorAt(0.99 / static_cast<qreal>(titleRect.height()), lightCol ); | |
+ gradient.setColorAt(1.0 / static_cast<qreal>(titleRect.height()), titleBarColor.lighter( 100 + m_internalSettings->backgroundGradientIntensity() ) ); | |
+ gradient.setColorAt(1.0, titleBarColor); | |
+ | |
painter->setBrush(gradient); | |
} else { | |
- painter->setBrush( titleBarColor() ); | |
+ QColor titleBarColor = this->titleBarColor(); | |
+ if( !opaqueTitleBar() ) | |
+ titleBarColor.setAlpha( qRound((qreal)m_internalSettings->backgroundOpacity() * (qreal)2.55) ); | |
+ | |
+ QLinearGradient gradient( 0, 0, 0, titleRect.height() ); | |
+ QColor lightCol( titleBarColor.lighter( 130 ) ); | |
+ gradient.setColorAt(0.0, lightCol ); | |
+ gradient.setColorAt(0.99 / static_cast<qreal>(titleRect.height()), lightCol ); | |
+ gradient.setColorAt(1.0 / static_cast<qreal>(titleRect.height()), titleBarColor ); | |
+ gradient.setColorAt(1.0, titleBarColor); | |
+ | |
+ painter->setBrush( gradient ); | |
} | |
@@ -606,7 +550,7 @@ namespace Breeze | |
} | |
- const QColor outlineColor( this->outlineColor() ); | |
+ /*const QColor outlineColor( this->outlineColor() ); | |
if( !c->isShaded() && outlineColor.isValid() ) | |
{ | |
// outline | |
@@ -614,12 +558,15 @@ namespace Breeze | |
painter->setBrush( Qt::NoBrush ); | |
painter->setPen( outlineColor ); | |
painter->drawLine( titleRect.bottomLeft(), titleRect.bottomRight() ); | |
- } | |
+ }*/ | |
painter->restore(); | |
// draw caption | |
- painter->setFont(s->font()); | |
+ QFont f; f.fromString(m_internalSettings->titleBarFont()); | |
+ // KDE needs this FIXME: Why? | |
+ QFontDatabase fd; f.setStyleName(fd.styleString(f)); | |
+ painter->setFont(f); | |
painter->setPen( fontColor() ); | |
const auto cR = captionRect(); | |
const QString caption = painter->fontMetrics().elidedText(c->caption(), Qt::ElideMiddle, cR.first.width()); | |
@@ -685,7 +632,9 @@ namespace Breeze | |
// full caption rect | |
const QRect fullRect = QRect( 0, yOffset, size().width(), captionHeight() ); | |
- QRect boundingRect( settings()->fontMetrics().boundingRect( c->caption()).toRect() ); | |
+ QFont f; f.fromString(m_internalSettings->titleBarFont()); | |
+ QFontMetrics fm(f); | |
+ QRect boundingRect( fm.boundingRect( c->caption()) ); | |
// text bounding rect | |
boundingRect.setTop( yOffset ); | |
@@ -707,92 +656,105 @@ namespace Breeze | |
//________________________________________________________________ | |
void Decoration::createShadow() | |
{ | |
- if (!g_sShadow | |
- ||g_shadowSizeEnum != m_internalSettings->shadowSize() | |
- || g_shadowStrength != m_internalSettings->shadowStrength() | |
- || g_shadowColor != m_internalSettings->shadowColor()) | |
+ | |
+ // assign global shadow if exists and parameters match | |
+ if( | |
+ !g_sShadow || | |
+ g_shadowSizeEnum != m_internalSettings->shadowSize() || | |
+ g_shadowStrength != m_internalSettings->shadowStrength() || | |
+ g_shadowColor != m_internalSettings->shadowColor() | |
+ ) | |
{ | |
+ // assign parameters | |
g_shadowSizeEnum = m_internalSettings->shadowSize(); | |
g_shadowStrength = m_internalSettings->shadowStrength(); | |
g_shadowColor = m_internalSettings->shadowColor(); | |
- const CompositeShadowParams params = lookupShadowParams(g_shadowSizeEnum); | |
- if (params.isNone()) { | |
- g_sShadow.clear(); | |
- setShadow(g_sShadow); | |
- return; | |
+ // shadow size from enum | |
+ int shadowSize = 0; | |
+ switch( g_shadowSizeEnum ) | |
+ { | |
+ default: | |
+ case InternalSettings::ShadowLarge: shadowSize = 64; break; | |
+ | |
+ case InternalSettings::ShadowNone: shadowSize = Metrics::Shadow_Overlap + 1; break; | |
+ case InternalSettings::ShadowSmall: shadowSize = 16; break; | |
+ case InternalSettings::ShadowMedium: shadowSize = 32; break; | |
+ case InternalSettings::ShadowVeryLarge: shadowSize = 96; break; | |
} | |
- auto withOpacity = [](const QColor &color, qreal opacity) -> QColor { | |
- QColor c(color); | |
- c.setAlphaF(opacity); | |
- return c; | |
+ // offset | |
+ int shadowOffset = (g_shadowSizeEnum == InternalSettings::ShadowNone) ? 0 : qMax( 6*shadowSize/16, Metrics::Shadow_Overlap*2 ); | |
+ | |
+ // create image | |
+ QImage image(2*shadowSize, 2*shadowSize, QImage::Format_ARGB32_Premultiplied); | |
+ image.fill(Qt::transparent); | |
+ | |
+ // painter | |
+ QPainter painter(&image); | |
+ painter.setRenderHint( QPainter::Antialiasing, true ); | |
+ | |
+ // color calculation delta function | |
+ auto gradientStopColor = [](QColor color, int alpha) | |
+ { | |
+ color.setAlpha(alpha); | |
+ return color; | |
}; | |
- // In order to properly render a box shadow with a given radius `shadowSize`, | |
- // the box size should be at least `2 * QSize(shadowSize, shadowSize)`. | |
- const int shadowSize = qMax(params.shadow1.radius, params.shadow2.radius); | |
- const QRect box(shadowSize, shadowSize, 2 * shadowSize + 1, 2 * shadowSize + 1); | |
- const QRect rect = box.adjusted(-shadowSize, -shadowSize, shadowSize, shadowSize); | |
- | |
- QImage shadow(rect.size(), QImage::Format_ARGB32_Premultiplied); | |
- shadow.fill(Qt::transparent); | |
- | |
- QPainter painter(&shadow); | |
- painter.setRenderHint(QPainter::Antialiasing); | |
- | |
- const qreal strength = static_cast<qreal>(g_shadowStrength) / 255.0; | |
- | |
- // Draw the "shape" shadow. | |
- BoxShadowHelper::boxShadow( | |
- &painter, | |
- box, | |
- params.shadow1.offset, | |
- params.shadow1.radius, | |
- withOpacity(g_shadowColor, params.shadow1.opacity * strength)); | |
- | |
- // Draw the "contrast" shadow. | |
- BoxShadowHelper::boxShadow( | |
- &painter, | |
- box, | |
- params.shadow2.offset, | |
- params.shadow2.radius, | |
- withOpacity(g_shadowColor, params.shadow2.opacity * strength)); | |
- | |
- // Mask out inner rect. | |
- const QMargins padding = QMargins( | |
- shadowSize - Metrics::Shadow_Overlap - params.offset.x(), | |
- shadowSize - Metrics::Shadow_Overlap - params.offset.y(), | |
- shadowSize - Metrics::Shadow_Overlap + params.offset.x(), | |
- shadowSize - Metrics::Shadow_Overlap + params.offset.y()); | |
- const QRect innerRect = rect - padding; | |
- | |
- painter.setPen(Qt::NoPen); | |
- painter.setBrush(Qt::black); | |
- painter.setCompositionMode(QPainter::CompositionMode_DestinationOut); | |
- painter.drawRoundedRect( | |
- innerRect, | |
- Metrics::Frame_FrameRadius + 0.5, | |
- Metrics::Frame_FrameRadius + 0.5); | |
- | |
- // Draw outline. | |
- painter.setPen(withOpacity(g_shadowColor, 0.2 * strength)); | |
- painter.setBrush(Qt::NoBrush); | |
- painter.setCompositionMode(QPainter::CompositionMode_SourceOver); | |
- painter.drawRoundedRect( | |
- innerRect, | |
- Metrics::Frame_FrameRadius - 0.5, | |
- Metrics::Frame_FrameRadius - 0.5); | |
+ // create gradient | |
+ if( g_shadowSizeEnum != InternalSettings::ShadowNone ) | |
+ { | |
+ | |
+ // gaussian lambda function | |
+ auto alpha = [](qreal x) { return std::exp( -x*x/0.15 ); }; | |
+ | |
+ QRadialGradient radialGradient( shadowSize, shadowSize, shadowSize ); | |
+ for( int i = 0; i < 10; ++i ) | |
+ { | |
+ const qreal x( qreal( i )/9 ); | |
+ radialGradient.setColorAt(x, gradientStopColor( g_shadowColor, alpha(x)*g_shadowStrength ) ); | |
+ } | |
+ | |
+ radialGradient.setColorAt(1, gradientStopColor( g_shadowColor, 0 ) ); | |
+ | |
+ // fill | |
+ painter.fillRect( image.rect(), radialGradient); | |
+ | |
+ } | |
+ | |
+ // contrast pixel | |
+ QRectF innerRect = QRectF( | |
+ shadowSize - Metrics::Shadow_Overlap, shadowSize - shadowOffset - Metrics::Shadow_Overlap, | |
+ 2*Metrics::Shadow_Overlap, shadowOffset + 2*Metrics::Shadow_Overlap ); | |
+ | |
+ painter.setPen( gradientStopColor( g_shadowColor, (g_shadowSizeEnum == InternalSettings::ShadowNone) ? g_shadowStrength:(g_shadowStrength*0.5) ) ); | |
+ painter.setBrush( Qt::NoBrush ); | |
+ painter.drawRoundedRect( innerRect, -0.5 + Metrics::Frame_FrameRadius, -0.5 + Metrics::Frame_FrameRadius ); | |
+ | |
+ // mask out inner rect | |
+ painter.setPen( Qt::NoPen ); | |
+ painter.setBrush( Qt::black ); | |
+ painter.setCompositionMode(QPainter::CompositionMode_DestinationOut ); | |
+ painter.drawRoundedRect( innerRect, 0.5 + Metrics::Frame_FrameRadius, 0.5 + Metrics::Frame_FrameRadius ); | |
painter.end(); | |
g_sShadow = QSharedPointer<KDecoration2::DecorationShadow>::create(); | |
- g_sShadow->setPadding(padding); | |
- g_sShadow->setInnerShadowRect(QRect(shadow.rect().center(), QSize(1, 1))); | |
- g_sShadow->setShadow(shadow); | |
+ g_sShadow->setPadding( QMargins( | |
+ shadowSize - Metrics::Shadow_Overlap, | |
+ shadowSize - shadowOffset - Metrics::Shadow_Overlap, | |
+ shadowSize - Metrics::Shadow_Overlap, | |
+ shadowSize - Metrics::Shadow_Overlap ) ); | |
+ | |
+ g_sShadow->setInnerShadowRect(QRect( shadowSize, shadowSize, 1, 1) ); | |
+ | |
+ // assign image | |
+ g_sShadow->setShadow(image); | |
+ | |
} | |
setShadow(g_sShadow); | |
+ | |
} | |
//_________________________________________________________________ | |
diff --git a/kdecoration/breezedecoration.h b/kdecoration/breezedecoration.h | |
index 3c535b5..9a56d8f 100644 | |
--- a/kdecoration/breezedecoration.h | |
+++ b/kdecoration/breezedecoration.h | |
@@ -98,6 +98,8 @@ namespace Breeze | |
inline bool isBottomEdge() const; | |
inline bool hideTitleBar() const; | |
+ inline bool opaqueTitleBar() const; | |
+ inline bool flatTitleBar() const; | |
//@} | |
public Q_SLOTS: | |
@@ -150,6 +152,9 @@ namespace Breeze | |
//* active state change opacity | |
qreal m_opacity = 0; | |
+ int m_opacityValue = 0; | |
+ QColor m_windowColor; | |
+ | |
}; | |
bool Decoration::hasBorders() const | |
@@ -194,6 +199,12 @@ namespace Breeze | |
bool Decoration::hideTitleBar() const | |
{ return m_internalSettings->hideTitleBar() && !client().data()->isShaded(); } | |
+ bool Decoration::opaqueTitleBar() const | |
+ { return m_internalSettings->opaqueTitleBar(); } | |
+ | |
+ bool Decoration::flatTitleBar() const | |
+ { return m_internalSettings->flatTitleBar(); } | |
+ | |
} | |
#endif | |
diff --git a/kdecoration/breezeexceptionlist.cpp b/kdecoration/breezeexceptionlist.cpp | |
index 5b4622c..da2b030 100644 | |
--- a/kdecoration/breezeexceptionlist.cpp | |
+++ b/kdecoration/breezeexceptionlist.cpp | |
@@ -59,6 +59,8 @@ namespace Breeze | |
// propagate all features found in mask to the output configuration | |
if( exception.mask() & BorderSize ) configuration->setBorderSize( exception.borderSize() ); | |
configuration->setHideTitleBar( exception.hideTitleBar() ); | |
+ configuration->setOpaqueTitleBar( exception.opaqueTitleBar() ); | |
+ configuration->setFlatTitleBar( exception.flatTitleBar() ); | |
// append to exceptions | |
_exceptions.append( configuration ); | |
@@ -97,7 +99,7 @@ namespace Breeze | |
{ | |
// list of items to be written | |
- QStringList keys = { "Enabled", "ExceptionPattern", "ExceptionType", "HideTitleBar", "Mask", "BorderSize"}; | |
+ QStringList keys = { "Enabled", "ExceptionPattern", "ExceptionType", "HideTitleBar", "OpaqueTitleBar", "FlatTitleBar", "Mask", "BorderSize"}; | |
// write all items | |
foreach( auto key, keys ) | |
diff --git a/kdecoration/breezesettingsdata.kcfg b/kdecoration/breezesettingsdata.kcfg | |
index bb09a0e..7e0f4cf 100644 | |
--- a/kdecoration/breezesettingsdata.kcfg | |
+++ b/kdecoration/breezesettingsdata.kcfg | |
@@ -7,7 +7,7 @@ | |
<group name="Common"> | |
<entry name="ShadowStrength" type = "Int"> | |
- <default>255</default> | |
+ <default>90</default> | |
<min>25</min> | |
<max>255</max> | |
</entry> | |
@@ -28,11 +28,6 @@ | |
<default>35, 38, 41</default> | |
</entry> | |
- <!-- close button --> | |
- <entry name="OutlineCloseButton" type = "Bool"> | |
- <default>true</default> | |
- </entry> | |
- | |
</group> | |
<group name="Windeco"> | |
@@ -54,7 +49,7 @@ | |
<choice name="BorderVeryHuge" /> | |
<choice name="BorderOversized" /> | |
</choices> | |
- <default>BorderNoSides</default> | |
+ <default>BorderNone</default> | |
</entry> | |
<!-- title alignment --> | |
@@ -89,11 +84,30 @@ | |
<default>false</default> | |
</entry> | |
+ <entry name="MacOSButtons" type = "Bool"> | |
+ <default>true</default> | |
+ </entry> | |
+ | |
+ <entry name="BackgroundOpacity" type = "Int"> | |
+ <default>100</default> | |
+ </entry> | |
+ | |
+ <!-- close button --> | |
+ <entry name="OutlineCloseButton" type = "Bool"> | |
+ <default>false</default> | |
+ </entry> | |
+ | |
<!-- size grip --> | |
<entry name="DrawBackgroundGradient" type = "Bool"> | |
- <default>true</default> | |
+ <default>false</default> | |
</entry> | |
+ <entry name="BackgroundGradientIntensity" type = "Int"> | |
+ <default>20</default> | |
+ </entry> | |
+ | |
+ <entry name="TitleBarFont" type = "String"/> | |
+ | |
<!-- size grip --> | |
<entry name="DrawSizeGrip" type = "Bool"> | |
<default>false</default> | |
@@ -113,6 +127,16 @@ | |
<default>false</default> | |
</entry> | |
+ <!-- opaque title bar --> | |
+ <entry name="OpaqueTitleBar" type = "Bool"> | |
+ <default>false</default> | |
+ </entry> | |
+ | |
+ <!-- flat title bar --> | |
+ <entry name="FlatTitleBar" type = "Bool"> | |
+ <default>false</default> | |
+ </entry> | |
+ | |
<!-- window specific settings --> | |
<entry name="ExceptionType" type="Enum"> | |
<choices> | |
diff --git a/kdecoration/breezesizegrip.cpp b/kdecoration/breezesizegrip.cpp | |
index 37060bc..87c716c 100644 | |
--- a/kdecoration/breezesizegrip.cpp | |
+++ b/kdecoration/breezesizegrip.cpp | |
@@ -51,11 +51,13 @@ namespace Breeze | |
setFixedSize( QSize( GripSize, GripSize ) ); | |
// mask | |
- setMask( QRegion( QVector<QPoint>{ | |
- QPoint( 0, GripSize ), | |
- QPoint( GripSize, 0 ), | |
- QPoint( GripSize, GripSize ), | |
- QPoint( 0, GripSize )} ) ); | |
+ QPolygon p; | |
+ p << QPoint( 0, GripSize ) | |
+ << QPoint( GripSize, 0 ) | |
+ << QPoint( GripSize, GripSize ) | |
+ << QPoint( 0, GripSize ); | |
+ | |
+ setMask( QRegion( p ) ); | |
// embed | |
embed(); | |
@@ -145,11 +147,13 @@ namespace Breeze | |
painter.setBrush( backgroundColor ); | |
// polygon | |
- painter.drawPolygon( QVector<QPoint> { | |
- QPoint( 0, GripSize ), | |
- QPoint( GripSize, 0 ), | |
- QPoint( GripSize, GripSize ), | |
- QPoint( 0, GripSize )} ); | |
+ QPolygon p; | |
+ p << QPoint( 0, GripSize ) | |
+ << QPoint( GripSize, 0 ) | |
+ << QPoint( GripSize, GripSize ) | |
+ << QPoint( 0, GripSize ); | |
+ painter.drawPolygon( p ); | |
+ | |
} | |
//_____________________________________________ | |
@@ -181,7 +185,7 @@ namespace Breeze | |
} | |
- | |
+ | |
} | |
//_______________________________________________________________________________ | |
diff --git a/kdecoration/config/breezeconfigwidget.cpp b/kdecoration/config/breezeconfigwidget.cpp | |
index 49f5a12..5f4d205 100644 | |
--- a/kdecoration/config/breezeconfigwidget.cpp | |
+++ b/kdecoration/config/breezeconfigwidget.cpp | |
@@ -48,11 +48,19 @@ namespace Breeze | |
// track ui changes | |
connect( m_ui.titleAlignment, SIGNAL(currentIndexChanged(int)), SLOT(updateChanged()) ); | |
connect( m_ui.buttonSize, SIGNAL(currentIndexChanged(int)), SLOT(updateChanged()) ); | |
+ m_ui.outlineCloseButton->hide(); | |
connect( m_ui.outlineCloseButton, SIGNAL(clicked()), SLOT(updateChanged()) ); | |
connect( m_ui.drawBorderOnMaximizedWindows, SIGNAL(clicked()), SLOT(updateChanged()) ); | |
connect( m_ui.drawSizeGrip, SIGNAL(clicked()), SLOT(updateChanged()) ); | |
connect( m_ui.drawBackgroundGradient, SIGNAL(clicked()), SLOT(updateChanged()) ); | |
- connect( m_ui.drawTitleBarSeparator, SIGNAL(clicked()), SLOT(updateChanged()) ); | |
+ connect( m_ui.macOSButtons, SIGNAL(clicked()), SLOT(updateChanged()) ); | |
+ connect( m_ui.opacitySpinBox, QOverload<int>::of(&QSpinBox::valueChanged), [=](int /*i*/){updateChanged();} ); | |
+ connect( m_ui.gradientSpinBox, QOverload<int>::of(&QSpinBox::valueChanged), [=](int /*i*/){updateChanged();} ); | |
+ | |
+ connect( m_ui.fontComboBox, &QFontComboBox::currentFontChanged, [this] { updateChanged(); } ); | |
+ connect( m_ui.fontSizeSpinBox, QOverload<int>::of(&QSpinBox::valueChanged), [=](int /*i*/){updateChanged();} ); | |
+ connect( m_ui.boldCheckBox, &QCheckBox::stateChanged, [this] { updateChanged(); } ); | |
+ connect( m_ui.italicCheckBox, &QCheckBox::stateChanged, [this] { updateChanged(); } ); | |
// track animations changes | |
connect( m_ui.animationsEnabled, SIGNAL(clicked()), SLOT(updateChanged()) ); | |
@@ -85,7 +93,18 @@ namespace Breeze | |
m_ui.drawBackgroundGradient->setChecked( m_internalSettings->drawBackgroundGradient() ); | |
m_ui.animationsEnabled->setChecked( m_internalSettings->animationsEnabled() ); | |
m_ui.animationsDuration->setValue( m_internalSettings->animationsDuration() ); | |
- m_ui.drawTitleBarSeparator->setChecked( m_internalSettings->drawTitleBarSeparator() ); | |
+ m_ui.macOSButtons->setChecked( m_internalSettings->macOSButtons() ); | |
+ m_ui.opacitySpinBox->setValue( m_internalSettings->backgroundOpacity() ); | |
+ m_ui.gradientSpinBox->setValue( m_internalSettings->backgroundGradientIntensity() ); | |
+ | |
+ QString fontStr = m_internalSettings->titleBarFont(); | |
+ if (fontStr.isEmpty()) | |
+ fontStr = QLatin1String("Sans,11,-1,5,50,0,0,0,0,0"); | |
+ QFont f; f.fromString( fontStr ); | |
+ m_ui.fontComboBox->setCurrentFont( f ); | |
+ m_ui.fontSizeSpinBox->setValue( f.pointSize() ); | |
+ m_ui.boldCheckBox->setChecked( f.bold() ); | |
+ m_ui.italicCheckBox->setChecked( f.italic() ); | |
// load shadows | |
if( m_internalSettings->shadowSize() <= InternalSettings::ShadowVeryLarge ) m_ui.shadowSize->setCurrentIndex( m_internalSettings->shadowSize() ); | |
@@ -119,7 +138,15 @@ namespace Breeze | |
m_internalSettings->setDrawBackgroundGradient( m_ui.drawBackgroundGradient->isChecked() ); | |
m_internalSettings->setAnimationsEnabled( m_ui.animationsEnabled->isChecked() ); | |
m_internalSettings->setAnimationsDuration( m_ui.animationsDuration->value() ); | |
- m_internalSettings->setDrawTitleBarSeparator(m_ui.drawTitleBarSeparator->isChecked()); | |
+ m_internalSettings->setMacOSButtons(m_ui.macOSButtons->isChecked()); | |
+ m_internalSettings->setBackgroundOpacity(m_ui.opacitySpinBox->value()); | |
+ m_internalSettings->setBackgroundGradientIntensity(m_ui.gradientSpinBox->value()); | |
+ | |
+ QFont f = m_ui.fontComboBox->currentFont(); | |
+ f.setPointSize(m_ui.fontSizeSpinBox->value()); | |
+ f.setBold(m_ui.boldCheckBox->isChecked()); | |
+ f.setItalic(m_ui.italicCheckBox->isChecked()); | |
+ m_internalSettings->setTitleBarFont(f.toString()); | |
m_internalSettings->setShadowSize( m_ui.shadowSize->currentIndex() ); | |
m_internalSettings->setShadowStrength( qRound( qreal(m_ui.shadowStrength->value()*255)/100 ) ); | |
@@ -166,7 +193,15 @@ namespace Breeze | |
m_ui.drawBackgroundGradient->setChecked( m_internalSettings->drawBackgroundGradient() ); | |
m_ui.animationsEnabled->setChecked( m_internalSettings->animationsEnabled() ); | |
m_ui.animationsDuration->setValue( m_internalSettings->animationsDuration() ); | |
- m_ui.drawTitleBarSeparator->setChecked( m_internalSettings->drawTitleBarSeparator() ); | |
+ m_ui.macOSButtons->setChecked( m_internalSettings->macOSButtons() ); | |
+ m_ui.opacitySpinBox->setValue( m_internalSettings->backgroundOpacity() ); | |
+ m_ui.gradientSpinBox->setValue( m_internalSettings->backgroundGradientIntensity() ); | |
+ | |
+ QFont f; f.fromString("Sans,11,-1,5,50,0,0,0,0,0"); | |
+ m_ui.fontComboBox->setCurrentFont( f ); | |
+ m_ui.fontSizeSpinBox->setValue( f.pointSize() ); | |
+ m_ui.boldCheckBox->setChecked( f.bold() ); | |
+ m_ui.italicCheckBox->setChecked( f.italic() ); | |
m_ui.shadowSize->setCurrentIndex( m_internalSettings->shadowSize() ); | |
m_ui.shadowStrength->setValue( qRound(qreal(m_internalSettings->shadowStrength()*100)/255 ) ); | |
@@ -183,14 +218,23 @@ namespace Breeze | |
// track modifications | |
bool modified( false ); | |
+ QFont f; f.fromString( m_internalSettings->titleBarFont() ); | |
- if (m_ui.drawTitleBarSeparator->isChecked() != m_internalSettings->drawTitleBarSeparator()) modified = true; | |
+ if (m_ui.macOSButtons->isChecked() != m_internalSettings->macOSButtons()) modified = true; | |
if( m_ui.titleAlignment->currentIndex() != m_internalSettings->titleAlignment() ) modified = true; | |
else if( m_ui.buttonSize->currentIndex() != m_internalSettings->buttonSize() ) modified = true; | |
else if( m_ui.outlineCloseButton->isChecked() != m_internalSettings->outlineCloseButton() ) modified = true; | |
else if( m_ui.drawBorderOnMaximizedWindows->isChecked() != m_internalSettings->drawBorderOnMaximizedWindows() ) modified = true; | |
else if( m_ui.drawSizeGrip->isChecked() != m_internalSettings->drawSizeGrip() ) modified = true; | |
else if( m_ui.drawBackgroundGradient->isChecked() != m_internalSettings->drawBackgroundGradient() ) modified = true; | |
+ else if( m_ui.opacitySpinBox->value() != m_internalSettings->backgroundOpacity() ) modified = true; | |
+ else if( m_ui.gradientSpinBox->value() != m_internalSettings->backgroundGradientIntensity() ) modified = true; | |
+ | |
+ // font | |
+ else if( m_ui.fontComboBox->currentFont().toString() != f.family() ) modified = true; | |
+ else if( m_ui.fontSizeSpinBox->value() != f.pointSize() ) modified = true; | |
+ else if( m_ui.boldCheckBox->isChecked() != f.bold() ) modified = true; | |
+ else if( m_ui.italicCheckBox->isChecked() != f.italic() ) modified = true; | |
// animations | |
else if( m_ui.animationsEnabled->isChecked() != m_internalSettings->animationsEnabled() ) modified = true; | |
diff --git a/kdecoration/config/breezeexceptiondialog.cpp b/kdecoration/config/breezeexceptiondialog.cpp | |
index d2b348a..446647d 100644 | |
--- a/kdecoration/config/breezeexceptiondialog.cpp | |
+++ b/kdecoration/config/breezeexceptiondialog.cpp | |
@@ -58,6 +58,8 @@ namespace Breeze | |
{ connect( iter.value(), SIGNAL(clicked()), SLOT(updateChanged()) ); } | |
connect( m_ui.hideTitleBar, SIGNAL(clicked()), SLOT(updateChanged()) ); | |
+ connect( m_ui.opaqueTitleBar, SIGNAL(clicked()), SLOT(updateChanged()) ); | |
+ connect( m_ui.flatTitleBar, SIGNAL(clicked()), SLOT(updateChanged()) ); | |
// hide detection dialog on non X11 platforms | |
#if BREEZE_HAVE_X11 | |
@@ -79,6 +81,8 @@ namespace Breeze | |
m_ui.exceptionEditor->setText( m_exception->exceptionPattern() ); | |
m_ui.borderSizeComboBox->setCurrentIndex( m_exception->borderSize() ); | |
m_ui.hideTitleBar->setChecked( m_exception->hideTitleBar() ); | |
+ m_ui.opaqueTitleBar->setChecked( m_exception->opaqueTitleBar() ); | |
+ m_ui.flatTitleBar->setChecked( m_exception->flatTitleBar() ); | |
// mask | |
for( CheckBoxMap::iterator iter = m_checkboxes.begin(); iter != m_checkboxes.end(); ++iter ) | |
@@ -95,6 +99,8 @@ namespace Breeze | |
m_exception->setExceptionPattern( m_ui.exceptionEditor->text() ); | |
m_exception->setBorderSize( m_ui.borderSizeComboBox->currentIndex() ); | |
m_exception->setHideTitleBar( m_ui.hideTitleBar->isChecked() ); | |
+ m_exception->setOpaqueTitleBar( m_ui.opaqueTitleBar->isChecked() ); | |
+ m_exception->setFlatTitleBar( m_ui.flatTitleBar->isChecked() ); | |
// mask | |
unsigned int mask = None; | |
@@ -115,6 +121,8 @@ namespace Breeze | |
else if( m_exception->exceptionPattern() != m_ui.exceptionEditor->text() ) modified = true; | |
else if( m_exception->borderSize() != m_ui.borderSizeComboBox->currentIndex() ) modified = true; | |
else if( m_exception->hideTitleBar() != m_ui.hideTitleBar->isChecked() ) modified = true; | |
+ else if( m_exception->opaqueTitleBar() != m_ui.opaqueTitleBar->isChecked() ) modified = true; | |
+ else if( m_exception->flatTitleBar() != m_ui.flatTitleBar->isChecked() ) modified = true; | |
else | |
{ | |
// check mask | |
diff --git a/kdecoration/config/breezelistmodel.h b/kdecoration/config/breezelistmodel.h | |
index 3e42661..182478c 100644 | |
--- a/kdecoration/config/breezelistmodel.h | |
+++ b/kdecoration/config/breezelistmodel.h | |
@@ -282,7 +282,7 @@ namespace Breeze | |
} | |
//! return all values | |
- const List& get( void ) const | |
+ const List& get() const | |
{ return _values; } | |
//! return value for given index | |
@@ -322,7 +322,7 @@ namespace Breeze | |
protected: | |
//! return all values | |
- List& _get( void ) | |
+ List& _get() | |
{ return _values; } | |
//! add, without update | |
diff --git a/kdecoration/config/ui/breezeconfigurationui.ui b/kdecoration/config/ui/breezeconfigurationui.ui | |
index 8899ee9..39d50ea 100644 | |
--- a/kdecoration/config/ui/breezeconfigurationui.ui | |
+++ b/kdecoration/config/ui/breezeconfigurationui.ui | |
@@ -24,6 +24,39 @@ | |
<string>General</string> | |
</attribute> | |
<layout class="QGridLayout" name="gridLayout_4"> | |
+ <item row="0" column="2"> | |
+ <spacer name="horizontalSpacer"> | |
+ <property name="orientation"> | |
+ <enum>Qt::Horizontal</enum> | |
+ </property> | |
+ <property name="sizeHint" stdset="0"> | |
+ <size> | |
+ <width>40</width> | |
+ <height>20</height> | |
+ </size> | |
+ </property> | |
+ </spacer> | |
+ </item> | |
+ <item row="12" column="0" colspan="3"> | |
+ <spacer name="verticalSpacer"> | |
+ <property name="orientation"> | |
+ <enum>Qt::Vertical</enum> | |
+ </property> | |
+ <property name="sizeHint" stdset="0"> | |
+ <size> | |
+ <width>20</width> | |
+ <height>40</height> | |
+ </size> | |
+ </property> | |
+ </spacer> | |
+ </item> | |
+ <item row="7" column="0" colspan="3"> | |
+ <widget class="QCheckBox" name="drawSizeGrip"> | |
+ <property name="text"> | |
+ <string>Add handle to resize windows with no border</string> | |
+ </property> | |
+ </widget> | |
+ </item> | |
<item row="0" column="0"> | |
<widget class="QLabel" name="label_3"> | |
<property name="text"> | |
@@ -103,67 +136,163 @@ | |
</item> | |
</widget> | |
</item> | |
- <item row="0" column="2"> | |
- <spacer name="horizontalSpacer"> | |
- <property name="orientation"> | |
- <enum>Qt::Horizontal</enum> | |
- </property> | |
- <property name="sizeHint" stdset="0"> | |
- <size> | |
- <width>40</width> | |
- <height>20</height> | |
- </size> | |
- </property> | |
- </spacer> | |
- </item> | |
- <item row="7" column="0" colspan="3"> | |
- <spacer name="verticalSpacer"> | |
- <property name="orientation"> | |
- <enum>Qt::Vertical</enum> | |
- </property> | |
- <property name="sizeHint" stdset="0"> | |
- <size> | |
- <width>20</width> | |
- <height>40</height> | |
- </size> | |
- </property> | |
- </spacer> | |
- </item> | |
- <item row="5" column="0" colspan="3"> | |
- <widget class="QCheckBox" name="drawSizeGrip"> | |
- <property name="text"> | |
- <string>Add handle to resize windows with no border</string> | |
- </property> | |
- </widget> | |
- </item> | |
- <item row="6" column="0" colspan="3"> | |
- <widget class="QCheckBox" name="drawTitleBarSeparator"> | |
+ <item row="8" column="0" colspan="3"> | |
+ <widget class="QCheckBox" name="macOSButtons"> | |
<property name="text"> | |
- <string>Draw separator between Title Bar and Window</string> | |
+ <string>macOS-like buttons</string> | |
</property> | |
</widget> | |
</item> | |
- <item row="3" column="0" colspan="3"> | |
+ <item row="4" column="0" colspan="3"> | |
<widget class="QCheckBox" name="drawBorderOnMaximizedWindows"> | |
<property name="text"> | |
<string>Allow resizing maximized windows from window edges</string> | |
</property> | |
</widget> | |
</item> | |
- <item row="2" column="0" colspan="3"> | |
+ <item row="3" column="0" colspan="3"> | |
<widget class="QCheckBox" name="outlineCloseButton"> | |
<property name="text"> | |
<string>Draw a circle around close button</string> | |
</property> | |
</widget> | |
</item> | |
- <item row="4" column="0" colspan="3"> | |
+ <item row="5" column="0" colspan="3"> | |
<widget class="QCheckBox" name="drawBackgroundGradient"> | |
<property name="text"> | |
<string>Draw window background gradient</string> | |
</property> | |
</widget> | |
</item> | |
+ <item row="6" column="0"> | |
+ <widget class="QLabel" name="label_7"> | |
+ <property name="enabled"> | |
+ <bool>false</bool> | |
+ </property> | |
+ <property name="text"> | |
+ <string>Gradient intensity:</string> | |
+ </property> | |
+ <property name="alignment"> | |
+ <set>Qt::AlignRight|Qt::AlignTrailing|Qt::AlignVCenter</set> | |
+ </property> | |
+ </widget> | |
+ </item> | |
+ <item row="6" column="1" alignment="Qt::AlignLeft"> | |
+ <widget class="QSpinBox" name="gradientSpinBox"> | |
+ <property name="enabled"> | |
+ <bool>false</bool> | |
+ </property> | |
+ <property name="suffix"> | |
+ <string> %</string> | |
+ </property> | |
+ <property name="maximum"> | |
+ <number>100</number> | |
+ </property> | |
+ </widget> | |
+ </item> | |
+ <item row="9" column="0" colspan="3"> | |
+ <layout class="QGridLayout" name="gridLayout_2" columnstretch="0,0,0,1"> | |
+ <item row="0" column="0"> | |
+ <widget class="QLabel" name="label_6"> | |
+ <property name="text"> | |
+ <string>Opacity:</string> | |
+ </property> | |
+ </widget> | |
+ </item> | |
+ <item row="0" column="1"> | |
+ <widget class="QSpinBox" name="opacitySpinBox"> | |
+ <property name="suffix"> | |
+ <string> %</string> | |
+ </property> | |
+ <property name="maximum"> | |
+ <number>100</number> | |
+ </property> | |
+ </widget> | |
+ </item> | |
+ <item row="0" column="2"> | |
+ <spacer name="horizontalSpacer_6"> | |
+ <property name="orientation"> | |
+ <enum>Qt::Horizontal</enum> | |
+ </property> | |
+ <property name="sizeHint" stdset="0"> | |
+ <size> | |
+ <width>5</width> | |
+ <height>5</height> | |
+ </size> | |
+ </property> | |
+ </spacer> | |
+ </item> | |
+ <item row="1" column="0" colspan="3"> | |
+ <widget class="QGroupBox" name="groupBox"> | |
+ <property name="title"> | |
+ <string>Font:</string> | |
+ </property> | |
+ <layout class="QGridLayout" name="gridLayout_3"> | |
+ <item row="0" column="0" colspan="3"> | |
+ <widget class="QFontComboBox" name="fontComboBox"/> | |
+ </item> | |
+ <item row="1" column="1"> | |
+ <widget class="QSpinBox" name="fontSizeSpinBox"> | |
+ <property name="minimum"> | |
+ <number>5</number> | |
+ </property> | |
+ <property name="maximum"> | |
+ <number>50</number> | |
+ </property> | |
+ </widget> | |
+ </item> | |
+ <item row="1" column="0"> | |
+ <widget class="QLabel" name="label_9"> | |
+ <property name="text"> | |
+ <string>Size:</string> | |
+ </property> | |
+ </widget> | |
+ </item> | |
+ <item row="1" column="2"> | |
+ <spacer name="horizontalSpacer_3"> | |
+ <property name="orientation"> | |
+ <enum>Qt::Horizontal</enum> | |
+ </property> | |
+ <property name="sizeHint" stdset="0"> | |
+ <size> | |
+ <width>5</width> | |
+ <height>5</height> | |
+ </size> | |
+ </property> | |
+ </spacer> | |
+ </item> | |
+ <item row="2" column="0" colspan="2"> | |
+ <widget class="QCheckBox" name="boldCheckBox"> | |
+ <property name="text"> | |
+ <string>Bold</string> | |
+ </property> | |
+ </widget> | |
+ </item> | |
+ <item row="3" column="0" colspan="2"> | |
+ <widget class="QCheckBox" name="italicCheckBox"> | |
+ <property name="text"> | |
+ <string>Italic</string> | |
+ </property> | |
+ </widget> | |
+ </item> | |
+ </layout> | |
+ </widget> | |
+ </item> | |
+ <item row="1" column="3"> | |
+ <spacer name="horizontalSpacer_2"> | |
+ <property name="orientation"> | |
+ <enum>Qt::Horizontal</enum> | |
+ </property> | |
+ <property name="sizeHint" stdset="0"> | |
+ <size> | |
+ <width>5</width> | |
+ <height>5</height> | |
+ </size> | |
+ </property> | |
+ </spacer> | |
+ </item> | |
+ </layout> | |
+ </item> | |
</layout> | |
</widget> | |
<widget class="QWidget" name="tab_2"> | |
@@ -432,5 +561,37 @@ | |
</hint> | |
</hints> | |
</connection> | |
+ <connection> | |
+ <sender>drawBackgroundGradient</sender> | |
+ <signal>toggled(bool)</signal> | |
+ <receiver>gradientSpinBox</receiver> | |
+ <slot>setEnabled(bool)</slot> | |
+ <hints> | |
+ <hint type="sourcelabel"> | |
+ <x>222</x> | |
+ <y>160</y> | |
+ </hint> | |
+ <hint type="destinationlabel"> | |
+ <x>166</x> | |
+ <y>188</y> | |
+ </hint> | |
+ </hints> | |
+ </connection> | |
+ <connection> | |
+ <sender>drawBackgroundGradient</sender> | |
+ <signal>toggled(bool)</signal> | |
+ <receiver>label_7</receiver> | |
+ <slot>setEnabled(bool)</slot> | |
+ <hints> | |
+ <hint type="sourcelabel"> | |
+ <x>222</x> | |
+ <y>160</y> | |
+ </hint> | |
+ <hint type="destinationlabel"> | |
+ <x>64</x> | |
+ <y>57</y> | |
+ </hint> | |
+ </hints> | |
+ </connection> | |
</connections> | |
</ui> | |
diff --git a/kdecoration/config/ui/breezeexceptiondialog.ui b/kdecoration/config/ui/breezeexceptiondialog.ui | |
index 3f78a44..c05db86 100644 | |
--- a/kdecoration/config/ui/breezeexceptiondialog.ui | |
+++ b/kdecoration/config/ui/breezeexceptiondialog.ui | |
@@ -90,13 +90,6 @@ | |
</property> | |
</widget> | |
</item> | |
- <item row="2" column="0" colspan="2"> | |
- <widget class="QCheckBox" name="hideTitleBar"> | |
- <property name="text"> | |
- <string>Hide window title bar</string> | |
- </property> | |
- </widget> | |
- </item> | |
<item row="0" column="1"> | |
<widget class="QComboBox" name="borderSizeComboBox"> | |
<property name="enabled"> | |
@@ -149,7 +142,7 @@ | |
</item> | |
</widget> | |
</item> | |
- <item row="3" column="0" colspan="2"> | |
+ <item row="4" column="0" colspan="2"> | |
<spacer name="verticalSpacer"> | |
<property name="orientation"> | |
<enum>Qt::Vertical</enum> | |
@@ -162,6 +155,27 @@ | |
</property> | |
</spacer> | |
</item> | |
+ <item row="1" column="0"> | |
+ <widget class="QCheckBox" name="hideTitleBar"> | |
+ <property name="text"> | |
+ <string>Hide window title bar</string> | |
+ </property> | |
+ </widget> | |
+ </item> | |
+ <item row="2" column="0"> | |
+ <widget class="QCheckBox" name="opaqueTitleBar"> | |
+ <property name="text"> | |
+ <string>Opaque title bar</string> | |
+ </property> | |
+ </widget> | |
+ </item> | |
+ <item row="3" column="0"> | |
+ <widget class="QCheckBox" name="flatTitleBar"> | |
+ <property name="text"> | |
+ <string>Flat title bar</string> | |
+ </property> | |
+ </widget> | |
+ </item> | |
</layout> | |
</widget> | |
</item> |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment