From 0ee4fa1bd74943a69ace0fab3be706e49cccb622 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Mart=C3=ADn=20Lucas=20Golini?= Date: Thu, 24 Mar 2022 17:49:57 -0300 Subject: [PATCH] Improved breeze light theme. --- bin/assets/ui/breeze.css | 69 ++++++++++++++----- src/eepp/ui/css/mediaquery.cpp | 2 +- .../ui/css/stylesheetpropertyanimation.cpp | 10 ++- src/eepp/ui/uinode.cpp | 9 ++- src/tools/codeeditor/codeeditor.cpp | 2 +- 5 files changed, 68 insertions(+), 24 deletions(-) diff --git a/bin/assets/ui/breeze.css b/bin/assets/ui/breeze.css index f1692d0b2..b42abd01a 100644 --- a/bin/assets/ui/breeze.css +++ b/bin/assets/ui/breeze.css @@ -37,48 +37,50 @@ --menu-font-active: white; --menu-font-disabled: #6e7275; --win-icon: #dbdbdd; + --floating-icon: #eff0f188; } @media (prefers-color-scheme: light) { :root { --primary: #3daee9; - --back: #fcfcfc; + --back: #eff0f1; --font: #232627; --font-hint: #232627; - --button-back: #eff0f1; - --button-border: #6b6f73; + --button-back: #fcfcfc; + --button-border: #b3b4b5; --button-radius: 2dp; --base-horizontal-padding: 5dp; --base-vertical-padding: 5dp; --border-width: 1dp; - --list-back: #eff0f1; - --separator: #383a3d; + --list-back: #ffffff; + --separator: #cbcdcd; --item-hover: #93cee9; - --scroll-button: #6b6d6f; - --slider-back: #676a6e; - --slider-button: #31363b; - --slider-border: #787b80; - --scrollbar-border: #373a3d; - --scrollbar-button: #4085a9; - --scrollbar-hback-hover: #606365; + --scroll-button: #cbcdcd; + --slider-back: #e9e9e9; + --slider-button: #cbcdcd; + --slider-border: #e6e6e6; + --scrollbar-border: #e6e6e6; + --scrollbar-button: #cbcdcd; + --scrollbar-hback-hover: #e9e9e9; --tab-back: #eff0f1; - --tab-line: #616569; + --tab-line: #e6e6e6; --tab-active: #fcfcfc; --tab-hover: #93cee9; - --tab-close: #909396; - --tab-close-hover: #863d47; + --tab-close: #e6e6e6; + --tab-close-hover: #e49aa2; --icon: #232627; --icon-active: #3daee9; - --icon-back-hover: #eff0f1; - --icon-line-hover: #3d4246; + --icon-back-hover: #e6e6e6; + --icon-line-hover: #232627; --icon-back-alert: #e49aa2; --menu-back: #eff0f1; --menu-font: #232627; - --menu-border: #616569; + --menu-border: #b3b4b5; --menu-font-active: #fcfcfc; - --menu-font-disabled: #6e7275; + --menu-font-disabled: #a8a9aa; --win-icon: #232627; + --floating-icon: #cbcdcd; } Menu::Item:selected, @@ -110,6 +112,31 @@ listview::cell::text { color: var(--font); } +tableview::row:selected tableview::cell::text, +treeview::row:selected treeview::cell::text, +listview::row:selected listview::cell::text, +tableview::row:selected tableview::cell::icon, +treeview::row:selected treeview::cell::icon, +listview::row:selected listview::cell::icon, +tableview::row:selected tableview::cell::expander, +treeview::row:selected treeview::cell::expander, +listview::row:selected listview::cell::expander, +tableview::row:hover tableview::cell::text, +treeview::row:hover treeview::cell::text, +listview::row:hover listview::cell::text, +tableview::row:hover tableview::cell::icon, +treeview::row:hover treeview::cell::icon, +listview::row:hover listview::cell::icon, +tableview::row:hover tableview::cell::expander, +treeview::row:hover treeview::cell::expander, +listview::row:hover listview::cell::expander, +tableview::header::column:hover, +treeview::header::column:hover, +listview::header::column:hover { + color: var(--menu-font-active); + tint: var(--menu-font-active); +} + Tab:selected, Tab:hover, Tab:pressed { @@ -135,6 +162,10 @@ Tooltip { color: var(--back)!important; } +Splitter::separator { + background-color: var(--back); +} + } CheckBox, diff --git a/src/eepp/ui/css/mediaquery.cpp b/src/eepp/ui/css/mediaquery.cpp index 624012652..223e8f175 100644 --- a/src/eepp/ui/css/mediaquery.cpp +++ b/src/eepp/ui/css/mediaquery.cpp @@ -93,7 +93,7 @@ MediaQuery::ptr MediaQuery::parse( const std::string& str ) { } else { StyleSheetLength length = StyleSheetLength::fromString( exprTokens[1] ); - expr.valStr = String::trim( String::toLower( exprTokens[1] ) ); + expr.valStr = String::toLower( exprTokens[1] ); if ( length.getUnit() == StyleSheetLength::Unit::Dpcm || length.getUnit() == StyleSheetLength::Unit::Dpi ) { diff --git a/src/eepp/ui/css/stylesheetpropertyanimation.cpp b/src/eepp/ui/css/stylesheetpropertyanimation.cpp index 7d75a3216..8d42d377a 100644 --- a/src/eepp/ui/css/stylesheetpropertyanimation.cpp +++ b/src/eepp/ui/css/stylesheetpropertyanimation.cpp @@ -34,6 +34,14 @@ void StyleSheetPropertyAnimation::tweenProperty( UIWidget* widget, const Float& case PropertyType::Color: { Color startColor( startValue ); Color endColor( endValue ); + if ( startColor.getValue() == 0 ) { + startColor = endColor; + startColor.a = 0; + } + if ( endColor.getValue() == 0 ) { + endColor = startColor; + endColor.a = 0; + } Float progress = easingCb[timingFunction]( normalizedProgress, 0, 1, 1.f ); Color resColor( startColor ); resColor.r = static_cast( eemin( @@ -189,7 +197,7 @@ StyleSheetPropertyAnimation* StyleSheetPropertyAnimation::New( animation.setDelay( delay ); animation.setDuration( duration ); animation.setTimingFunction( timingFunction ); - return New( animation, property, {startValue, endValue}, {0, 1}, propertyIndex, + return New( animation, property, { startValue, endValue }, { 0, 1 }, propertyIndex, animationOrigin ); } diff --git a/src/eepp/ui/uinode.cpp b/src/eepp/ui/uinode.cpp index 303abaa56..a0667739d 100644 --- a/src/eepp/ui/uinode.cpp +++ b/src/eepp/ui/uinode.cpp @@ -347,6 +347,11 @@ void UINode::updateDebugData() { text += "Classes: " + String::join( widget->getStyleSheetClasses(), ' ' ) + "\n"; } + if ( !widget->getStyleSheetPseudoClasses().empty() ) { + text += "Pseudo Classes: " + String::join( widget->getStyleSheetPseudoClasses(), ' ' ) + + "\n"; + } + text += String::format( "X: %.2fpx (%.2fdp) Y: %.2fpx (%.2fdp)\nW: %.2fpx (%.2fdp) H: %.2fpx (%.2fdp)", mPosition.x, mDpPos.x, mPosition.y, mDpPos.y, mSize.x, mDpSize.x, mSize.y, mDpSize.y ); @@ -444,8 +449,8 @@ Uint32 UINode::onCalculateDrag( const Vector2f& position, const Uint32& flags ) if ( mDragPoint != pos && ( std::abs( mDragPoint.x - pos.x ) > 1.f || std::abs( mDragPoint.y - pos.y ) > 1.f ) ) { Sizef dragDiff; - dragDiff.x = ( mFlags & UI_DRAG_HORIZONTAL ) ? ( Float )( mDragPoint.x - pos.x ) : 0; - dragDiff.y = ( mFlags & UI_DRAG_VERTICAL ) ? ( Float )( mDragPoint.y - pos.y ) : 0; + dragDiff.x = ( mFlags & UI_DRAG_HORIZONTAL ) ? (Float)( mDragPoint.x - pos.x ) : 0; + dragDiff.y = ( mFlags & UI_DRAG_VERTICAL ) ? (Float)( mDragPoint.y - pos.y ) : 0; if ( onDrag( pos, flags, dragDiff ) ) { setPixelsPosition( mPosition - dragDiff ); diff --git a/src/tools/codeeditor/codeeditor.cpp b/src/tools/codeeditor/codeeditor.cpp index d8267093a..438b3cbac 100644 --- a/src/tools/codeeditor/codeeditor.cpp +++ b/src/tools/codeeditor/codeeditor.cpp @@ -2207,7 +2207,7 @@ void App::init( const std::string& file, const Float& pidelDensity, background-color: var(--icon-back-alert); } #settings { - color: #eff0f188; + color: var(--floating-icon); font-family: icon; font-size: 16dp; margin-top: 6dp;