Changeset View
Changeset View
Standalone View
Standalone View
src/PopupDropperFactory.cpp
Show All 15 Lines | |||||
16 | 16 | | |||
17 | #include "PopupDropperFactory.h" | 17 | #include "PopupDropperFactory.h" | ||
18 | 18 | | |||
19 | #include "MainWindow.h" | 19 | #include "MainWindow.h" | ||
20 | #include "PaletteHandler.h" | 20 | #include "PaletteHandler.h" | ||
21 | #include "SvgHandler.h" | 21 | #include "SvgHandler.h" | ||
22 | #include "core/support/Debug.h" | 22 | #include "core/support/Debug.h" | ||
23 | #include "context/popupdropper/libpud/PopupDropperItem.h" | 23 | #include "context/popupdropper/libpud/PopupDropperItem.h" | ||
24 | #include "context/ContextView.h" | | |||
25 | | ||||
26 | #include <kglobal.h> | | |||
27 | 24 | | |||
28 | #include <QAction> | 25 | #include <QAction> | ||
29 | 26 | | |||
30 | 27 | | |||
31 | namespace The | 28 | namespace The | ||
32 | { | 29 | { | ||
33 | static PopupDropperFactory* s_PopupDropperFactory_instance = 0; | 30 | static PopupDropperFactory* s_PopupDropperFactory_instance = 0; | ||
34 | 31 | | |||
Show All 37 Lines | 54 | { | |||
72 | pd->setFadeInTime( 500 ); | 69 | pd->setFadeInTime( 500 ); | ||
73 | pd->setFadeOutTime( 300 ); | 70 | pd->setFadeOutTime( 300 ); | ||
74 | //QColor origWindowColor( The::paletteHandler()->palette().color( QPalette::Window ) ); | 71 | //QColor origWindowColor( The::paletteHandler()->palette().color( QPalette::Window ) ); | ||
75 | //QColor windowColor; | 72 | //QColor windowColor; | ||
76 | //windowColor.setRed( 255 - origWindowColor.red() ); | 73 | //windowColor.setRed( 255 - origWindowColor.red() ); | ||
77 | //windowColor.setBlue( 255 - origWindowColor.blue() ); | 74 | //windowColor.setBlue( 255 - origWindowColor.blue() ); | ||
78 | //windowColor.setGreen( 255 - origWindowColor.green() ); | 75 | //windowColor.setGreen( 255 - origWindowColor.green() ); | ||
79 | QColor windowColor( The::paletteHandler()->palette().color( QPalette::Base ) ); | 76 | QColor windowColor( The::paletteHandler()->palette().color( QPalette::Base ) ); | ||
80 | windowColor.setAlpha( 176 ); | 77 | windowColor.setAlpha( 200 ); | ||
81 | QColor textColor( The::paletteHandler()->palette().color( QPalette::Link ) ); | 78 | QColor textColor( The::paletteHandler()->palette().color( QPalette::Link ) ); | ||
82 | QColor highlightedTextColor( The::paletteHandler()->palette().color( QPalette::LinkVisited ) ); | 79 | QColor highlightedTextColor( The::paletteHandler()->palette().color( QPalette::Text ) ); | ||
83 | QColor borderColor( The::paletteHandler()->palette().color( QPalette::Text ) ); | 80 | QColor borderColor( The::paletteHandler()->palette().color( QPalette::Text ) ); | ||
84 | QColor fillColor( borderColor ); | 81 | QColor fillColor( borderColor ); | ||
85 | fillColor.setAlpha( 48 ); | 82 | fillColor.setAlpha( 48 ); | ||
86 | pd->setColors( windowColor, textColor, highlightedTextColor, borderColor, fillColor ); | 83 | pd->setColors( windowColor, textColor, highlightedTextColor, borderColor, fillColor ); | ||
87 | 84 | | |||
88 | return pd; | 85 | return pd; | ||
89 | } | 86 | } | ||
90 | 87 | | |||
Show All 20 Lines | 100 | { | |||
111 | QColor hoverIndicatorFillColor( The::paletteHandler()->palette().color( QPalette::Highlight ) ); | 108 | QColor hoverIndicatorFillColor( The::paletteHandler()->palette().color( QPalette::Highlight ) ); | ||
112 | hoverIndicatorFillColor.setAlpha( 96 ); | 109 | hoverIndicatorFillColor.setAlpha( 96 ); | ||
113 | QBrush brush = item->hoverIndicatorFillBrush(); | 110 | QBrush brush = item->hoverIndicatorFillBrush(); | ||
114 | brush.setColor( hoverIndicatorFillColor ); | 111 | brush.setColor( hoverIndicatorFillColor ); | ||
115 | item->setHoverIndicatorFillBrush( brush ); | 112 | item->setHoverIndicatorFillBrush( brush ); | ||
116 | 113 | | |||
117 | if( item->isSubmenuTrigger() ) | 114 | if( item->isSubmenuTrigger() ) | ||
118 | item->setHoverIndicatorShowStyle( PopupDropperItem::OnHover ); | 115 | item->setHoverIndicatorShowStyle( PopupDropperItem::OnHover ); | ||
119 | | ||||
120 | } | 116 | } | ||
121 | 117 | | |||
122 | void PopupDropperFactory::adjustItems( PopupDropper* pud ) | 118 | void PopupDropperFactory::adjustItems( PopupDropper* pud ) | ||
123 | { | 119 | { | ||
124 | if( !pud ) | 120 | if( !pud ) | ||
125 | return; | 121 | return; | ||
126 | pud->forEachItem( adjustItemCallback ); | 122 | pud->forEachItem( adjustItemCallback ); | ||
127 | } | 123 | } | ||
128 | 124 | | |||
129 | void PopupDropperFactory::adjustItemCallback( void *pdi ) | 125 | void PopupDropperFactory::adjustItemCallback( void *pdi ) | ||
130 | { | 126 | { | ||
131 | The::popupDropperFactory()->adjustItem( (PopupDropperItem*)pdi ); | 127 | The::popupDropperFactory()->adjustItem( (PopupDropperItem*)pdi ); | ||
132 | } | 128 | } | ||
133 | 129 | |