Skip to content
Projeler
Gruplar
Parçacıklar
Yardım
Yükleniyor...
Oturum aç / Kaydol
Gezinmeyi değiştir
C
core
Proje
Proje
Ayrıntılar
Etkinlik
Cycle Analytics
Depo (repository)
Depo (repository)
Dosyalar
Kayıtlar (commit)
Dallar (branch)
Etiketler
Katkıda bulunanlar
Grafik
Karşılaştır
Grafikler
Konular (issue)
0
Konular (issue)
0
Liste
Pano
Etiketler
Kilometre Taşları
Birleştirme (merge) Talepleri
0
Birleştirme (merge) Talepleri
0
CI / CD
CI / CD
İş akışları (pipeline)
İşler
Zamanlamalar
Grafikler
Paketler
Paketler
Wiki
Wiki
Parçacıklar
Parçacıklar
Üyeler
Üyeler
Collapse sidebar
Close sidebar
Etkinlik
Grafik
Grafikler
Yeni bir konu (issue) oluştur
İşler
Kayıtlar (commit)
Konu (issue) Panoları
Kenar çubuğunu aç
LibreOffice
core
Commits
b70b4ae2
Kaydet (Commit)
b70b4ae2
authored
Eyl 04, 2015
tarafından
Tomaž Vajngerl
Dosyalara gözat
Seçenekler
Dosyalara Gözat
İndir
Eposta Yamaları
Sade Fark
fix slider drawing, change to always draw the whole widget
Change-Id: Ifca2f72962b808a355bd7dcc20babaeb61272bf8
üst
46cf9bb7
Hide whitespace changes
Inline
Side-by-side
Showing
2 changed files
with
23 additions
and
61 deletions
+23
-61
slider.hxx
include/vcl/slider.hxx
+1
-2
slider.cxx
vcl/source/control/slider.cxx
+22
-59
No files found.
include/vcl/slider.hxx
Dosyayı görüntüle @
b70b4ae2
...
@@ -47,7 +47,6 @@ private:
...
@@ -47,7 +47,6 @@ private:
long
mnPageSize
;
long
mnPageSize
;
long
mnDelta
;
long
mnDelta
;
sal_uInt16
mnDragDraw
;
sal_uInt16
mnDragDraw
;
sal_uInt16
mnDrawFlags
;
sal_uInt16
mnStateFlags
;
sal_uInt16
mnStateFlags
;
ScrollType
meScrollType
;
ScrollType
meScrollType
;
bool
mbCalcSize
;
bool
mbCalcSize
;
...
@@ -68,7 +67,7 @@ private:
...
@@ -68,7 +67,7 @@ private:
SAL_DLLPRIVATE
long
ImplCalcThumbPos
(
long
nPixPos
);
SAL_DLLPRIVATE
long
ImplCalcThumbPos
(
long
nPixPos
);
SAL_DLLPRIVATE
long
ImplCalcThumbPosPix
(
long
nPos
);
SAL_DLLPRIVATE
long
ImplCalcThumbPosPix
(
long
nPos
);
SAL_DLLPRIVATE
void
ImplCalc
(
bool
bUpdate
=
true
);
SAL_DLLPRIVATE
void
ImplCalc
(
bool
bUpdate
=
true
);
SAL_DLLPRIVATE
void
ImplDraw
(
vcl
::
RenderContext
&
rRenderContext
,
sal_uInt16
nDrawFlags
);
SAL_DLLPRIVATE
void
ImplDraw
(
vcl
::
RenderContext
&
rRenderContext
);
SAL_DLLPRIVATE
bool
ImplIsPageUp
(
const
Point
&
rPos
);
SAL_DLLPRIVATE
bool
ImplIsPageUp
(
const
Point
&
rPos
);
SAL_DLLPRIVATE
bool
ImplIsPageDown
(
const
Point
&
rPos
);
SAL_DLLPRIVATE
bool
ImplIsPageDown
(
const
Point
&
rPos
);
SAL_DLLPRIVATE
long
ImplSlide
(
long
nNewPos
,
bool
bCallEndSlide
);
SAL_DLLPRIVATE
long
ImplSlide
(
long
nNewPos
,
bool
bCallEndSlide
);
...
...
vcl/source/control/slider.cxx
Dosyayı görüntüle @
b70b4ae2
...
@@ -25,12 +25,6 @@
...
@@ -25,12 +25,6 @@
#include "thumbpos.hxx"
#include "thumbpos.hxx"
#define SLIDER_DRAW_THUMB ((sal_uInt16)0x0001)
#define SLIDER_DRAW_CHANNEL1 ((sal_uInt16)0x0002)
#define SLIDER_DRAW_CHANNEL2 ((sal_uInt16)0x0004)
#define SLIDER_DRAW_CHANNEL (SLIDER_DRAW_CHANNEL1 | SLIDER_DRAW_CHANNEL2)
#define SLIDER_DRAW_ALL (SLIDER_DRAW_THUMB | SLIDER_DRAW_CHANNEL)
#define SLIDER_STATE_CHANNEL1_DOWN ((sal_uInt16)0x0001)
#define SLIDER_STATE_CHANNEL1_DOWN ((sal_uInt16)0x0001)
#define SLIDER_STATE_CHANNEL2_DOWN ((sal_uInt16)0x0002)
#define SLIDER_STATE_CHANNEL2_DOWN ((sal_uInt16)0x0002)
#define SLIDER_STATE_THUMB_DOWN ((sal_uInt16)0x0004)
#define SLIDER_STATE_THUMB_DOWN ((sal_uInt16)0x0004)
...
@@ -62,7 +56,6 @@ void Slider::ImplInit( vcl::Window* pParent, WinBits nStyle )
...
@@ -62,7 +56,6 @@ void Slider::ImplInit( vcl::Window* pParent, WinBits nStyle )
mnPageSize
=
1
;
mnPageSize
=
1
;
mnDelta
=
0
;
mnDelta
=
0
;
mnDragDraw
=
0
;
mnDragDraw
=
0
;
mnDrawFlags
=
SLIDER_DRAW_ALL
;
mnStateFlags
=
0
;
mnStateFlags
=
0
;
meScrollType
=
SCROLL_DONTKNOW
;
meScrollType
=
SCROLL_DONTKNOW
;
mbCalcSize
=
true
;
mbCalcSize
=
true
;
...
@@ -203,9 +196,8 @@ void Slider::ImplUpdateRects( bool bUpdate )
...
@@ -203,9 +196,8 @@ void Slider::ImplUpdateRects( bool bUpdate )
{
{
if
(
aOldThumbRect
!=
maThumbRect
)
if
(
aOldThumbRect
!=
maThumbRect
)
{
{
mnDrawFlags
=
SLIDER_DRAW_ALL
;
if
(
bInvalidateAll
)
if
(
bInvalidateAll
)
Invalidate
();
Invalidate
(
InvalidateFlags
::
NoChildren
|
InvalidateFlags
::
NoErase
);
else
else
{
{
vcl
::
Region
aInvalidRegion
(
aOldThumbRect
);
vcl
::
Region
aInvalidRegion
(
aOldThumbRect
);
...
@@ -339,14 +331,13 @@ void Slider::ImplCalc( bool bUpdate )
...
@@ -339,14 +331,13 @@ void Slider::ImplCalc( bool bUpdate )
if
(
bUpdate
&&
bInvalidateAll
)
if
(
bUpdate
&&
bInvalidateAll
)
{
{
mnDrawFlags
=
SLIDER_DRAW_ALL
;
Invalidate
();
Invalidate
();
bUpdate
=
false
;
bUpdate
=
false
;
}
}
ImplUpdateRects
(
bUpdate
);
ImplUpdateRects
(
bUpdate
);
}
}
void
Slider
::
ImplDraw
(
vcl
::
RenderContext
&
rRenderContext
,
sal_uInt16
nDrawFlags
)
void
Slider
::
ImplDraw
(
vcl
::
RenderContext
&
rRenderContext
)
{
{
DecorationView
aDecoView
(
&
rRenderContext
);
DecorationView
aDecoView
(
&
rRenderContext
);
DrawButtonFlags
nStyle
;
DrawButtonFlags
nStyle
;
...
@@ -378,7 +369,7 @@ void Slider::ImplDraw(vcl::RenderContext& rRenderContext, sal_uInt16 nDrawFlags)
...
@@ -378,7 +369,7 @@ void Slider::ImplDraw(vcl::RenderContext& rRenderContext, sal_uInt16 nDrawFlags)
if
(
bNativeOK
)
if
(
bNativeOK
)
return
;
return
;
if
(
(
nDrawFlags
&
SLIDER_DRAW_CHANNEL1
)
&&
!
maChannel1Rect
.
IsEmpty
())
if
(
!
maChannel1Rect
.
IsEmpty
())
{
{
long
nRectSize
;
long
nRectSize
;
Rectangle
aRect
=
maChannel1Rect
;
Rectangle
aRect
=
maChannel1Rect
;
...
@@ -422,7 +413,7 @@ void Slider::ImplDraw(vcl::RenderContext& rRenderContext, sal_uInt16 nDrawFlags)
...
@@ -422,7 +413,7 @@ void Slider::ImplDraw(vcl::RenderContext& rRenderContext, sal_uInt16 nDrawFlags)
}
}
}
}
if
(
(
nDrawFlags
&
SLIDER_DRAW_CHANNEL2
)
&&
!
maChannel2Rect
.
IsEmpty
())
if
(
!
maChannel2Rect
.
IsEmpty
())
{
{
long
nRectSize
;
long
nRectSize
;
Rectangle
aRect
=
maChannel2Rect
;
Rectangle
aRect
=
maChannel2Rect
;
...
@@ -463,23 +454,20 @@ void Slider::ImplDraw(vcl::RenderContext& rRenderContext, sal_uInt16 nDrawFlags)
...
@@ -463,23 +454,20 @@ void Slider::ImplDraw(vcl::RenderContext& rRenderContext, sal_uInt16 nDrawFlags)
}
}
}
}
if
(
nDrawFlags
&
SLIDER_DRAW_THUMB
)
if
(
!
maThumbRect
.
IsEmpty
()
)
{
{
if
(
!
maThumbRect
.
IsEmpty
()
)
if
(
bEnabled
)
{
{
if
(
bEnabled
)
nStyle
=
DrawButtonFlags
::
NONE
;
{
if
(
mnStateFlags
&
SLIDER_STATE_THUMB_DOWN
)
nStyle
=
DrawButtonFlags
::
NONE
;
nStyle
|=
DrawButtonFlags
::
Pressed
;
if
(
mnStateFlags
&
SLIDER_STATE_THUMB_DOWN
)
aDecoView
.
DrawButton
(
maThumbRect
,
nStyle
);
nStyle
|=
DrawButtonFlags
::
Pressed
;
}
aDecoView
.
DrawButton
(
maThumbRect
,
nStyle
);
else
}
{
else
rRenderContext
.
SetLineColor
(
rStyleSettings
.
GetShadowColor
());
{
rRenderContext
.
SetFillColor
(
rStyleSettings
.
GetCheckedColor
());
rRenderContext
.
SetLineColor
(
rStyleSettings
.
GetShadowColor
());
rRenderContext
.
DrawRect
(
maThumbRect
);
rRenderContext
.
SetFillColor
(
rStyleSettings
.
GetCheckedColor
());
rRenderContext
.
DrawRect
(
maThumbRect
);
}
}
}
}
}
}
}
...
@@ -614,18 +602,12 @@ void Slider::ImplDoMouseAction( const Point& rMousePos, bool bCallAction )
...
@@ -614,18 +602,12 @@ void Slider::ImplDoMouseAction( const Point& rMousePos, bool bCallAction )
{
{
if
(
ImplDoAction
(
false
)
)
if
(
ImplDoAction
(
false
)
)
{
{
// Update the channel complete
Update
();
if
(
mnDragDraw
&
SLIDER_DRAW_CHANNEL
)
Invalidate
();
{
Update
();
mnDrawFlags
=
mnDragDraw
;
Invalidate
();
}
}
}
}
}
else
if
(
nOldStateFlags
!=
mnStateFlags
)
else
if
(
nOldStateFlags
!=
mnStateFlags
)
{
{
mnDrawFlags
=
mnDragDraw
;
Invalidate
();
Invalidate
();
}
}
}
}
...
@@ -664,7 +646,6 @@ void Slider::MouseButtonDown( const MouseEvent& rMEvt )
...
@@ -664,7 +646,6 @@ void Slider::MouseButtonDown( const MouseEvent& rMEvt )
if
(
maThumbRect
.
IsInside
(
rMousePos
)
)
if
(
maThumbRect
.
IsInside
(
rMousePos
)
)
{
{
meScrollType
=
SCROLL_DRAG
;
meScrollType
=
SCROLL_DRAG
;
mnDragDraw
=
SLIDER_DRAW_THUMB
;
// calculate additional values
// calculate additional values
Point
aCenterPos
=
maThumbRect
.
Center
();
Point
aCenterPos
=
maThumbRect
.
Center
();
...
@@ -682,8 +663,6 @@ void Slider::MouseButtonDown( const MouseEvent& rMEvt )
...
@@ -682,8 +663,6 @@ void Slider::MouseButtonDown( const MouseEvent& rMEvt )
nTrackFlags
=
StartTrackingFlags
::
ButtonRepeat
;
nTrackFlags
=
StartTrackingFlags
::
ButtonRepeat
;
meScrollType
=
SCROLL_PAGEUP
;
meScrollType
=
SCROLL_PAGEUP
;
}
}
mnDragDraw
=
SLIDER_DRAW_CHANNEL
;
}
}
else
if
(
ImplIsPageDown
(
rMousePos
)
)
else
if
(
ImplIsPageDown
(
rMousePos
)
)
{
{
...
@@ -694,8 +673,6 @@ void Slider::MouseButtonDown( const MouseEvent& rMEvt )
...
@@ -694,8 +673,6 @@ void Slider::MouseButtonDown( const MouseEvent& rMEvt )
nTrackFlags
=
StartTrackingFlags
::
ButtonRepeat
;
nTrackFlags
=
StartTrackingFlags
::
ButtonRepeat
;
meScrollType
=
SCROLL_PAGEDOWN
;
meScrollType
=
SCROLL_PAGEDOWN
;
}
}
mnDragDraw
=
SLIDER_DRAW_CHANNEL
;
}
}
// Shall we start Tracking?
// Shall we start Tracking?
...
@@ -723,10 +700,8 @@ void Slider::MouseButtonUp( const MouseEvent& )
...
@@ -723,10 +700,8 @@ void Slider::MouseButtonUp( const MouseEvent& )
if
(
nOldStateFlags
!=
mnStateFlags
)
if
(
nOldStateFlags
!=
mnStateFlags
)
{
{
mnDrawFlags
=
mnDragDraw
;
Invalidate
(
InvalidateFlags
::
NoChildren
|
InvalidateFlags
::
NoErase
);
Invalidate
();
}
}
mnDragDraw
=
0
;
ImplDoAction
(
true
);
ImplDoAction
(
true
);
meScrollType
=
SCROLL_DONTKNOW
;
meScrollType
=
SCROLL_DONTKNOW
;
}
}
...
@@ -742,10 +717,8 @@ void Slider::Tracking( const TrackingEvent& rTEvt )
...
@@ -742,10 +717,8 @@ void Slider::Tracking( const TrackingEvent& rTEvt )
SLIDER_STATE_THUMB_DOWN
);
SLIDER_STATE_THUMB_DOWN
);
if
(
nOldStateFlags
!=
mnStateFlags
)
if
(
nOldStateFlags
!=
mnStateFlags
)
{
{
mnDrawFlags
=
mnDragDraw
;
Invalidate
(
InvalidateFlags
::
NoChildren
|
InvalidateFlags
::
NoErase
);
Invalidate
();
}
}
mnDragDraw
=
0
;
// on cancel, reset the previous Thumb position
// on cancel, reset the previous Thumb position
if
(
rTEvt
.
IsTrackingCanceled
()
)
if
(
rTEvt
.
IsTrackingCanceled
()
)
...
@@ -863,11 +836,7 @@ void Slider::KeyInput( const KeyEvent& rKEvt )
...
@@ -863,11 +836,7 @@ void Slider::KeyInput( const KeyEvent& rKEvt )
void
Slider
::
Paint
(
vcl
::
RenderContext
&
rRenderContext
,
const
Rectangle
&
/*rRect*/
)
void
Slider
::
Paint
(
vcl
::
RenderContext
&
rRenderContext
,
const
Rectangle
&
/*rRect*/
)
{
{
if
(
mnDrawFlags
)
ImplDraw
(
rRenderContext
);
{
ImplDraw
(
rRenderContext
,
mnDrawFlags
);
mnDrawFlags
=
0
;
}
}
}
void
Slider
::
Resize
()
void
Slider
::
Resize
()
...
@@ -876,8 +845,7 @@ void Slider::Resize()
...
@@ -876,8 +845,7 @@ void Slider::Resize()
mbCalcSize
=
true
;
mbCalcSize
=
true
;
if
(
IsReallyVisible
()
)
if
(
IsReallyVisible
()
)
ImplCalc
(
false
);
ImplCalc
(
false
);
mnDrawFlags
=
SLIDER_DRAW_ALL
;
Invalidate
(
InvalidateFlags
::
NoChildren
|
InvalidateFlags
::
NoErase
);
Invalidate
();
}
}
void
Slider
::
SetLinkedField
(
VclPtr
<
NumericField
>
pField
)
void
Slider
::
SetLinkedField
(
VclPtr
<
NumericField
>
pField
)
...
@@ -908,7 +876,6 @@ void Slider::StateChanged( StateChangedType nType )
...
@@ -908,7 +876,6 @@ void Slider::StateChanged( StateChangedType nType )
if
(
IsReallyVisible
()
&&
IsUpdateMode
()
)
if
(
IsReallyVisible
()
&&
IsUpdateMode
()
)
{
{
ImplCalc
(
false
);
ImplCalc
(
false
);
mnDrawFlags
=
SLIDER_DRAW_ALL
;
Invalidate
();
Invalidate
();
}
}
}
}
...
@@ -916,7 +883,6 @@ void Slider::StateChanged( StateChangedType nType )
...
@@ -916,7 +883,6 @@ void Slider::StateChanged( StateChangedType nType )
{
{
if
(
IsReallyVisible
()
&&
IsUpdateMode
()
)
if
(
IsReallyVisible
()
&&
IsUpdateMode
()
)
{
{
mnDrawFlags
=
SLIDER_DRAW_ALL
;
Invalidate
();
Invalidate
();
}
}
}
}
...
@@ -929,7 +895,6 @@ void Slider::StateChanged( StateChangedType nType )
...
@@ -929,7 +895,6 @@ void Slider::StateChanged( StateChangedType nType )
{
{
mbCalcSize
=
true
;
mbCalcSize
=
true
;
ImplCalc
(
false
);
ImplCalc
(
false
);
mnDrawFlags
=
SLIDER_DRAW_ALL
;
Invalidate
();
Invalidate
();
}
}
}
}
...
@@ -937,7 +902,6 @@ void Slider::StateChanged( StateChangedType nType )
...
@@ -937,7 +902,6 @@ void Slider::StateChanged( StateChangedType nType )
else
if
(
nType
==
StateChangedType
::
ControlBackground
)
else
if
(
nType
==
StateChangedType
::
ControlBackground
)
{
{
ImplInitSettings
();
ImplInitSettings
();
mnDrawFlags
=
SLIDER_DRAW_ALL
;
Invalidate
();
Invalidate
();
}
}
}
}
...
@@ -950,7 +914,6 @@ void Slider::DataChanged( const DataChangedEvent& rDCEvt )
...
@@ -950,7 +914,6 @@ void Slider::DataChanged( const DataChangedEvent& rDCEvt )
(
rDCEvt
.
GetFlags
()
&
AllSettingsFlags
::
STYLE
)
)
(
rDCEvt
.
GetFlags
()
&
AllSettingsFlags
::
STYLE
)
)
{
{
ImplInitSettings
();
ImplInitSettings
();
mnDrawFlags
=
SLIDER_DRAW_ALL
;
Invalidate
();
Invalidate
();
}
}
}
}
...
...
Write
Preview
Markdown
is supported
0%
Try again
or
attach a new file
Attach a file
Cancel
You are about to add
0
people
to the discussion. Proceed with caution.
Finish editing this message first!
Cancel
Please
register
or
sign in
to comment