diff options
author | Stephan Bergmann <sbergman@redhat.com> | 2015-05-08 11:56:28 +0200 |
---|---|---|
committer | Stephan Bergmann <sbergman@redhat.com> | 2015-05-08 11:56:28 +0200 |
commit | 79776356d9597f3c0e06f8e81019909bdbb1a560 (patch) | |
tree | a796093412477145d606ab9895994b658cbfeaf4 /vcl/unx/kde/salnativewidgets-kde.cxx | |
parent | 80743f11fcdb49f997b0a8ff08bee28a0f2cfce7 (diff) |
loplugin:staticmethods
Change-Id: Ie3629a14c7a15a0f5f93a4bfc663a2bb52a8735d
Diffstat (limited to 'vcl/unx/kde/salnativewidgets-kde.cxx')
-rw-r--r-- | vcl/unx/kde/salnativewidgets-kde.cxx | 76 |
1 files changed, 38 insertions, 38 deletions
diff --git a/vcl/unx/kde/salnativewidgets-kde.cxx b/vcl/unx/kde/salnativewidgets-kde.cxx index 180e595f2d60..627a15597a64 100644 --- a/vcl/unx/kde/salnativewidgets-kde.cxx +++ b/vcl/unx/kde/salnativewidgets-kde.cxx @@ -79,6 +79,44 @@ using namespace ::com::sun::star; +namespace { + +/** Style conversion function. + + Conversion function between VCL ControlState together with ImplControlValue + and Qt state flags. + + @param nState + State of the widget (default, focused, ...) as defined in Native Widget + Framework. + + @param aValue + Value held by the widget (on, off, ...) +*/ +QStyle::SFlags vclStateValue2SFlags( ControlState nState, + const ImplControlValue& aValue ) +{ + QStyle::SFlags nStyle = + ( (nState & ControlState::DEFAULT)? QStyle::Style_ButtonDefault: QStyle::Style_Default ) | + ( (nState & ControlState::ENABLED)? QStyle::Style_Enabled: QStyle::Style_Default ) | + ( (nState & ControlState::FOCUSED)? QStyle::Style_HasFocus: QStyle::Style_Default ) | + ( (nState & ControlState::PRESSED)? QStyle::Style_Down: QStyle::Style_Raised ) | + ( (nState & ControlState::SELECTED)? QStyle::Style_Selected : QStyle::Style_Default ) | + ( (nState & ControlState::ROLLOVER)? QStyle::Style_MouseOver: QStyle::Style_Default ); + //TODO ( (nState & ControlState::HIDDEN)? QStyle::Style_: QStyle::Style_Default ) | + + switch ( aValue.getTristateVal() ) + { + case BUTTONVALUE_ON: nStyle |= QStyle::Style_On; break; + case BUTTONVALUE_OFF: nStyle |= QStyle::Style_Off; break; + case BUTTONVALUE_MIXED: nStyle |= QStyle::Style_NoChange; break; + default: break; + } + + return nStyle; +} + +} /** Qt implementation of X11Pixmap @@ -417,21 +455,6 @@ class WidgetPainter // TODO other widgets - protected: - /** Style conversion function. - - Conversion function between VCL ControlState together with - ImplControlValue and Qt state flags. - - @param nState - State of the widget (default, focused, ...) as defined in Native - Widget Framework. - - @param aValue - Value held by the widget (on, off, ...) - */ - QStyle::SFlags vclStateValue2SFlags( ControlState nState, const ImplControlValue& aValue ); - public: /** Convert VCL Rectangle to QRect. @@ -1197,29 +1220,6 @@ QProgressBar *WidgetPainter::progressBar( const Rectangle& rControlRegion ) return m_pProgressBar; } -QStyle::SFlags WidgetPainter::vclStateValue2SFlags( ControlState nState, - const ImplControlValue& aValue ) -{ - QStyle::SFlags nStyle = - ( (nState & ControlState::DEFAULT)? QStyle::Style_ButtonDefault: QStyle::Style_Default ) | - ( (nState & ControlState::ENABLED)? QStyle::Style_Enabled: QStyle::Style_Default ) | - ( (nState & ControlState::FOCUSED)? QStyle::Style_HasFocus: QStyle::Style_Default ) | - ( (nState & ControlState::PRESSED)? QStyle::Style_Down: QStyle::Style_Raised ) | - ( (nState & ControlState::SELECTED)? QStyle::Style_Selected : QStyle::Style_Default ) | - ( (nState & ControlState::ROLLOVER)? QStyle::Style_MouseOver: QStyle::Style_Default ); - //TODO ( (nState & ControlState::HIDDEN)? QStyle::Style_: QStyle::Style_Default ) | - - switch ( aValue.getTristateVal() ) - { - case BUTTONVALUE_ON: nStyle |= QStyle::Style_On; break; - case BUTTONVALUE_OFF: nStyle |= QStyle::Style_Off; break; - case BUTTONVALUE_MIXED: nStyle |= QStyle::Style_NoChange; break; - default: break; - } - - return nStyle; -} - QRect WidgetPainter::region2QRect( const Rectangle& rControlRegion ) { return QRect( QPoint( rControlRegion.Left(), rControlRegion.Top() ), |