summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorNoel Grandin <noel.grandin@collabora.co.uk>2017-08-18 16:38:48 +0200
committerNoel Grandin <noel.grandin@collabora.co.uk>2017-08-19 06:53:51 +0200
commit50acead19bd13a344f8ca9b3879f8e8cb0b24eb7 (patch)
tree89a87c4192744c95a6626d78b80c63cff3fdcf54
parent4105174973aaabc25148e53571b7a4fc356098de (diff)
convert WB_SLIDERSET to a bool field
Change-Id: I8a3767e162a14069937d52f5eb57ae5cd7f3fa7b Reviewed-on: https://gerrit.libreoffice.org/41302 Reviewed-by: Noel Grandin <noel.grandin@collabora.co.uk> Tested-by: Noel Grandin <noel.grandin@collabora.co.uk>
-rw-r--r--avmedia/source/framework/MediaControlBase.cxx3
-rw-r--r--avmedia/source/framework/mediacontrol.cxx6
-rw-r--r--include/tools/wintypes.hxx4
-rw-r--r--include/vcl/slider.hxx2
-rw-r--r--vcl/source/control/slider.cxx5
5 files changed, 11 insertions, 9 deletions
diff --git a/avmedia/source/framework/MediaControlBase.cxx b/avmedia/source/framework/MediaControlBase.cxx
index 09bd5bf146af..a0a03f9eb783 100644
--- a/avmedia/source/framework/MediaControlBase.cxx
+++ b/avmedia/source/framework/MediaControlBase.cxx
@@ -133,7 +133,8 @@ void MediaControlBase::InitializeWidgets()
mpTimeSlider->SetRange( Range( 0, AVMEDIA_TIME_RANGE ) );
mpTimeSlider->SetUpdateMode( true );
- mpTimeSlider->SetStyle(WB_HORZ | WB_DRAG | WB_3DLOOK | WB_SLIDERSET);
+ mpTimeSlider->SetStyle(WB_HORZ | WB_DRAG | WB_3DLOOK);
+ mpTimeSlider->SetScrollTypeSet(true);
}
void MediaControlBase::UpdateToolBoxes(MediaItem aMediaItem)
diff --git a/avmedia/source/framework/mediacontrol.cxx b/avmedia/source/framework/mediacontrol.cxx
index 614430a325ae..b3dbf8f21cef 100644
--- a/avmedia/source/framework/mediacontrol.cxx
+++ b/avmedia/source/framework/mediacontrol.cxx
@@ -46,9 +46,11 @@ MediaControl::MediaControl( vcl::Window* pParent, MediaControlStyle eControlStyl
meControlStyle( eControlStyle )
{
mpPlayToolBox = VclPtr<ToolBox>::Create(this, WB_3DLOOK) ;
- mpTimeSlider = VclPtr<Slider>::Create(this, WB_HORZ | WB_DRAG | WB_3DLOOK | WB_SLIDERSET) ;
+ mpTimeSlider = VclPtr<Slider>::Create(this, WB_HORZ | WB_DRAG | WB_3DLOOK) ;
+ mpTimeSlider->SetScrollTypeSet(true);
mpMuteToolBox = VclPtr<ToolBox>::Create(this, WB_3DLOOK) ;
- mpVolumeSlider = VclPtr<Slider>::Create(this, WB_HORZ | WB_DRAG | WB_SLIDERSET) ;
+ mpVolumeSlider = VclPtr<Slider>::Create(this, WB_HORZ | WB_DRAG) ;
+ mpVolumeSlider->SetScrollTypeSet(true);
mpZoomToolBox = VclPtr<ToolBox>::Create(this, WB_3DLOOK) ;
mpZoomListBox = VclPtr<ListBox>::Create( mpZoomToolBox.get(), WB_BORDER | WB_DROPDOWN | WB_AUTOHSCROLL | WB_3DLOOK ) ;
mpTimeEdit = VclPtr<Edit>::Create(this, WB_CENTER | WB_READONLY | WB_BORDER | WB_3DLOOK ) ;
diff --git a/include/tools/wintypes.hxx b/include/tools/wintypes.hxx
index def5ffd6bb09..0eccec5cc259 100644
--- a/include/tools/wintypes.hxx
+++ b/include/tools/wintypes.hxx
@@ -267,11 +267,7 @@ WinBits const WB_PATH = 0x00100000;
WinBits const WB_OPEN = 0x00200000;
WinBits const WB_SAVEAS = 0x00400000;
-// For Slider
-// Window-Bits for TabControl
-WinBits const WB_SLIDERSET = 0x02000000;
-// WindowAlign
enum class WindowAlign { Left, Top, Right, Bottom };
diff --git a/include/vcl/slider.hxx b/include/vcl/slider.hxx
index f4536b4c9af6..879340fc387f 100644
--- a/include/vcl/slider.hxx
+++ b/include/vcl/slider.hxx
@@ -49,6 +49,7 @@ private:
ScrollType meScrollType;
bool mbCalcSize;
bool mbFullDrag;
+ bool mbScrollTypeSet;
VclPtr<NumericField> mpLinkedField;
@@ -104,6 +105,7 @@ public:
long GetLineSize() const { return mnLineSize; }
void SetPageSize( long nNewSize ) { mnPageSize = nNewSize; }
long GetPageSize() const { return mnPageSize; }
+ void SetScrollTypeSet(bool b) { mbScrollTypeSet = b; }
Size CalcWindowSizePixel();
diff --git a/vcl/source/control/slider.cxx b/vcl/source/control/slider.cxx
index 1bbf92750f25..102e10aae82a 100644
--- a/vcl/source/control/slider.cxx
+++ b/vcl/source/control/slider.cxx
@@ -57,6 +57,7 @@ void Slider::ImplInit( vcl::Window* pParent, WinBits nStyle )
meScrollType = ScrollType::DontKnow;
mbCalcSize = true;
mbFullDrag = true;
+ mbScrollTypeSet = false;
mpLinkedField = nullptr;
@@ -627,7 +628,7 @@ void Slider::MouseButtonDown( const MouseEvent& rMEvt )
}
else if ( ImplIsPageUp( rMousePos ) )
{
- if( GetStyle() & WB_SLIDERSET )
+ if( mbScrollTypeSet )
meScrollType = ScrollType::Set;
else
{
@@ -637,7 +638,7 @@ void Slider::MouseButtonDown( const MouseEvent& rMEvt )
}
else if ( ImplIsPageDown( rMousePos ) )
{
- if( GetStyle() & WB_SLIDERSET )
+ if( mbScrollTypeSet )
meScrollType = ScrollType::Set;
else
{