From 137bb940521afd0a5c0591d9edac17f4156c53f9 Mon Sep 17 00:00:00 2001 From: Tomaž Vajngerl Date: Tue, 11 Sep 2018 17:29:20 +0200 Subject: vcl: mark stock buttons and transfer this to NWF on drawing Stock buttons like OK/Cancel/Help need sometimes to be drawn differently than just another button. For this we need to mark such push buttons as "stock" when building them from a glade file and transfer this information down to the NWF backend when drawing the widget. Change-Id: I131657f026a731208db47f4c8220622c8aabb464 --- include/vcl/button.hxx | 11 +++++++++++ include/vcl/salnativewidgets.hxx | 13 +++++++++---- 2 files changed, 20 insertions(+), 4 deletions(-) (limited to 'include') diff --git a/include/vcl/button.hxx b/include/vcl/button.hxx index 38c094a2d9dc..76e16bf6dfb5 100644 --- a/include/vcl/button.hxx +++ b/include/vcl/button.hxx @@ -163,6 +163,16 @@ public: virtual bool set_property(const OString &rKey, const OUString &rValue) override; virtual void ShowFocus(const tools::Rectangle& rRect) override; + void setStock(bool bIsStock) + { + mbIsStock = bIsStock; + } + + bool isStock() + { + return mbIsStock; + } + protected: PushButtonDropdownStyle mnDDStyle; bool mbIsActive; @@ -199,6 +209,7 @@ private: SymbolType meSymbol; TriState meState; bool mbPressed; + bool mbIsStock; }; inline void PushButton::Check( bool bCheck ) diff --git a/include/vcl/salnativewidgets.hxx b/include/vcl/salnativewidgets.hxx index f6132e5bb17e..9ccfa0319057 100644 --- a/include/vcl/salnativewidgets.hxx +++ b/include/vcl/salnativewidgets.hxx @@ -494,8 +494,12 @@ class VCL_DLLPUBLIC PushButtonValue : public ImplControlValue { public: PushButtonValue() - : ImplControlValue( ControlType::Pushbutton, 0 ) - , mbBevelButton( false ), mbSingleLine( true ) {} + : ImplControlValue( ControlType::Pushbutton, 0 ) + , mbBevelButton(false) + , mbSingleLine(true) + , mbIsStock(false) + {} + virtual ~PushButtonValue() override; virtual PushButtonValue* clone() const override; @@ -504,8 +508,9 @@ public: PushButtonValue & operator =(PushButtonValue const &) = delete; // due to ImplControlValue PushButtonValue & operator =(PushButtonValue &&) = delete; // due to ImplControlValue - bool mbBevelButton:1; // only used on OSX - bool mbSingleLine:1; // only used on OSX + bool mbBevelButton:1; // only used on OSX + bool mbSingleLine:1; // only used on OSX + bool mbIsStock:1; }; -- cgit v1.2.3