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
9c9db856
Kaydet (Commit)
9c9db856
authored
May 19, 2015
tarafından
Jan Holesovsky
Dosyalara gözat
Seçenekler
Dosyalara Gözat
İndir
Eposta Yamaları
Sade Fark
rendercontext toolbar: Invalidate instead of direct paint.
Change-Id: Ib4c11d3f1ec793e66cd47c1f7bb4f7d06820d58f
üst
bbefb58c
Hide whitespace changes
Inline
Side-by-side
Showing
3 changed files
with
38 additions
and
40 deletions
+38
-40
toolbox.hxx
include/vcl/toolbox.hxx
+2
-2
toolbox.cxx
vcl/source/window/toolbox.cxx
+34
-36
toolbox2.cxx
vcl/source/window/toolbox2.cxx
+2
-2
No files found.
include/vcl/toolbox.hxx
Dosyayı görüntüle @
9c9db856
...
@@ -197,9 +197,9 @@ private:
...
@@ -197,9 +197,9 @@ private:
public
:
public
:
using
Window
::
ImplInit
;
using
Window
::
ImplInit
;
private
:
private
:
SAL_DLLPRIVATE
void
InvalidateItem
(
sal_uInt16
nPosition
,
sal_uInt16
nHighlight
=
0
,
bool
bPaint
=
false
,
bool
bLayout
=
false
);
SAL_DLLPRIVATE
void
InvalidateItem
(
sal_uInt16
nPosition
);
SAL_DLLPRIVATE
void
InvalidateSpin
(
bool
bUpperIn
,
bool
bLowerIn
);
SAL_DLLPRIVATE
void
InvalidateSpin
(
bool
bUpperIn
,
bool
bLowerIn
);
SAL_DLLPRIVATE
void
InvalidateMenuButton
(
bool
bHighlight
);
SAL_DLLPRIVATE
void
InvalidateMenuButton
();
SAL_DLLPRIVATE
void
ImplInit
(
vcl
::
Window
*
pParent
,
WinBits
nStyle
);
SAL_DLLPRIVATE
void
ImplInit
(
vcl
::
Window
*
pParent
,
WinBits
nStyle
);
using
DockingWindow
::
ImplInitSettings
;
using
DockingWindow
::
ImplInitSettings
;
...
...
vcl/source/window/toolbox.cxx
Dosyayı görüntüle @
9c9db856
...
@@ -1347,7 +1347,6 @@ IMPL_LINK( ImplTBDragMgr, SelectHdl, Accelerator*, pAccel )
...
@@ -1347,7 +1347,6 @@ IMPL_LINK( ImplTBDragMgr, SelectHdl, Accelerator*, pAccel )
void
ToolBox
::
ImplInit
(
vcl
::
Window
*
pParent
,
WinBits
nStyle
)
void
ToolBox
::
ImplInit
(
vcl
::
Window
*
pParent
,
WinBits
nStyle
)
{
{
// initialize variables
// initialize variables
ImplGetWindowImpl
()
->
mbToolBox
=
true
;
ImplGetWindowImpl
()
->
mbToolBox
=
true
;
mpData
=
new
ImplToolBoxPrivateData
;
mpData
=
new
ImplToolBoxPrivateData
;
...
@@ -3342,7 +3341,7 @@ void ToolBox::ImplFloatControl( bool bStart, FloatingWindow* pFloatWindow )
...
@@ -3342,7 +3341,7 @@ void ToolBox::ImplFloatControl( bool bStart, FloatingWindow* pFloatWindow )
mpFloatWin
=
pFloatWindow
;
mpFloatWin
=
pFloatWindow
;
// redraw item, to trigger drawing of a special border
// redraw item, to trigger drawing of a special border
InvalidateItem
(
mnCurPos
,
1
);
InvalidateItem
(
mnCurPos
);
mbDrag
=
false
;
mbDrag
=
false
;
EndTracking
();
EndTracking
();
...
@@ -3357,7 +3356,7 @@ void ToolBox::ImplFloatControl( bool bStart, FloatingWindow* pFloatWindow )
...
@@ -3357,7 +3356,7 @@ void ToolBox::ImplFloatControl( bool bStart, FloatingWindow* pFloatWindow )
bool
bWasKeyboardActivate
=
mpData
->
mbDropDownByKeyboard
;
bool
bWasKeyboardActivate
=
mpData
->
mbDropDownByKeyboard
;
if
(
mnCurPos
!=
TOOLBOX_ITEM_NOTFOUND
)
if
(
mnCurPos
!=
TOOLBOX_ITEM_NOTFOUND
)
InvalidateItem
(
mnCurPos
,
bWasKeyboardActivate
?
2
:
0
);
InvalidateItem
(
mnCurPos
);
Deactivate
();
Deactivate
();
if
(
!
bWasKeyboardActivate
)
if
(
!
bWasKeyboardActivate
)
...
@@ -3420,7 +3419,7 @@ bool ToolBox::ImplHandleMouseMove( const MouseEvent& rMEvt, bool bRepeat )
...
@@ -3420,7 +3419,7 @@ bool ToolBox::ImplHandleMouseMove( const MouseEvent& rMEvt, bool bRepeat )
{
{
if
(
!
mnCurItemId
)
if
(
!
mnCurItemId
)
{
{
InvalidateItem
(
mnCurPos
,
1
);
InvalidateItem
(
mnCurPos
);
mnCurItemId
=
pItem
->
mnId
;
mnCurItemId
=
pItem
->
mnId
;
Highlight
();
Highlight
();
}
}
...
@@ -3549,17 +3548,12 @@ bool ToolBox::ImplHandleMouseButtonUp( const MouseEvent& rMEvt, bool bCancel )
...
@@ -3549,17 +3548,12 @@ bool ToolBox::ImplHandleMouseButtonUp( const MouseEvent& rMEvt, bool bCancel )
// Items not destroyed, in Select handler
// Items not destroyed, in Select handler
if
(
mnCurItemId
)
if
(
mnCurItemId
)
{
{
sal_uInt16
nHighlight
;
if
(
(
mnCurItemId
==
mnHighItemId
)
&&
(
mnOutStyle
&
TOOLBOX_STYLE_FLAT
)
)
nHighlight
=
2
;
else
nHighlight
=
0
;
// Get current pos for the case that items are inserted/removed
// Get current pos for the case that items are inserted/removed
// in the toolBox
// in the toolBox
mnCurPos
=
GetItemPos
(
mnCurItemId
);
mnCurPos
=
GetItemPos
(
mnCurItemId
);
if
(
mnCurPos
!=
TOOLBOX_ITEM_NOTFOUND
)
if
(
mnCurPos
!=
TOOLBOX_ITEM_NOTFOUND
)
{
{
InvalidateItem
(
mnCurPos
,
nHighlight
);
InvalidateItem
(
mnCurPos
);
Flush
();
Flush
();
}
}
}
}
...
@@ -3655,7 +3649,7 @@ void ToolBox::MouseMove( const MouseEvent& rMEvt )
...
@@ -3655,7 +3649,7 @@ void ToolBox::MouseMove( const MouseEvent& rMEvt )
if
(
mnCurPos
!=
TOOLBOX_ITEM_NOTFOUND
)
if
(
mnCurPos
!=
TOOLBOX_ITEM_NOTFOUND
)
{
{
mnCurItemId
=
mnHighItemId
=
it
->
mnId
;
mnCurItemId
=
mnHighItemId
=
it
->
mnId
;
InvalidateItem
(
mnCurPos
,
2
);
// always use shadow effect (2)
InvalidateItem
(
mnCurPos
);
}
}
else
else
mnCurItemId
=
mnHighItemId
=
0
;
mnCurItemId
=
mnHighItemId
=
0
;
...
@@ -3750,10 +3744,10 @@ void ToolBox::MouseMove( const MouseEvent& rMEvt )
...
@@ -3750,10 +3744,10 @@ void ToolBox::MouseMove( const MouseEvent& rMEvt )
if
(
mpData
->
mbMenubuttonSelected
)
if
(
mpData
->
mbMenubuttonSelected
)
{
{
// remove highlight from menubutton
// remove highlight from menubutton
InvalidateMenuButton
(
false
);
InvalidateMenuButton
();
}
}
mnHighItemId
=
it
->
mnId
;
mnHighItemId
=
it
->
mnId
;
InvalidateItem
(
nTempPos
,
2
);
InvalidateItem
(
nTempPos
);
ImplShowFocus
();
ImplShowFocus
();
CallEventListeners
(
VCLEVENT_TOOLBOX_HIGHLIGHT
);
CallEventListeners
(
VCLEVENT_TOOLBOX_HIGHLIGHT
);
}
}
...
@@ -3773,7 +3767,7 @@ void ToolBox::MouseMove( const MouseEvent& rMEvt )
...
@@ -3773,7 +3767,7 @@ void ToolBox::MouseMove( const MouseEvent& rMEvt )
if
(
!
bMenuButtonHit
&&
mpData
->
mbMenubuttonSelected
)
if
(
!
bMenuButtonHit
&&
mpData
->
mbMenubuttonSelected
)
{
{
// remove highlight from menubutton
// remove highlight from menubutton
InvalidateMenuButton
(
false
);
InvalidateMenuButton
();
}
}
if
(
mnHighItemId
)
if
(
mnHighItemId
)
...
@@ -3781,7 +3775,7 @@ void ToolBox::MouseMove( const MouseEvent& rMEvt )
...
@@ -3781,7 +3775,7 @@ void ToolBox::MouseMove( const MouseEvent& rMEvt )
sal_uInt16
nClearPos
=
GetItemPos
(
mnHighItemId
);
sal_uInt16
nClearPos
=
GetItemPos
(
mnHighItemId
);
if
(
nClearPos
!=
TOOLBOX_ITEM_NOTFOUND
)
if
(
nClearPos
!=
TOOLBOX_ITEM_NOTFOUND
)
{
{
InvalidateItem
(
nClearPos
,
(
nClearPos
==
mnCurPos
)
?
1
:
0
);
InvalidateItem
(
nClearPos
);
if
(
nClearPos
!=
mnCurPos
)
if
(
nClearPos
!=
mnCurPos
)
CallEventListeners
(
VCLEVENT_TOOLBOX_HIGHLIGHTOFF
,
reinterpret_cast
<
void
*
>
(
nClearPos
)
);
CallEventListeners
(
VCLEVENT_TOOLBOX_HIGHLIGHTOFF
,
reinterpret_cast
<
void
*
>
(
nClearPos
)
);
}
}
...
@@ -3791,7 +3785,7 @@ void ToolBox::MouseMove( const MouseEvent& rMEvt )
...
@@ -3791,7 +3785,7 @@ void ToolBox::MouseMove( const MouseEvent& rMEvt )
if
(
bMenuButtonHit
)
if
(
bMenuButtonHit
)
{
{
InvalidateMenuButton
(
true
);
InvalidateMenuButton
();
}
}
}
}
}
}
...
@@ -3889,7 +3883,7 @@ void ToolBox::MouseButtonDown( const MouseEvent& rMEvt )
...
@@ -3889,7 +3883,7 @@ void ToolBox::MouseButtonDown( const MouseEvent& rMEvt )
if
(
mbSelection
)
if
(
mbSelection
)
{
{
InvalidateItem
(
mnCurPos
,
1
);
InvalidateItem
(
mnCurPos
);
Highlight
();
Highlight
();
}
}
else
else
...
@@ -3905,7 +3899,7 @@ void ToolBox::MouseButtonDown( const MouseEvent& rMEvt )
...
@@ -3905,7 +3899,7 @@ void ToolBox::MouseButtonDown( const MouseEvent& rMEvt )
if
(
mbDrag
)
if
(
mbDrag
)
{
{
InvalidateItem
(
mnCurPos
,
1
);
InvalidateItem
(
mnCurPos
);
Highlight
();
Highlight
();
}
}
...
@@ -3926,7 +3920,7 @@ void ToolBox::MouseButtonDown( const MouseEvent& rMEvt )
...
@@ -3926,7 +3920,7 @@ void ToolBox::MouseButtonDown( const MouseEvent& rMEvt )
{
{
// no floater was opened
// no floater was opened
Deactivate
();
Deactivate
();
InvalidateItem
(
mnCurPos
,
0
);
InvalidateItem
(
mnCurPos
);
mnCurPos
=
TOOLBOX_ITEM_NOTFOUND
;
mnCurPos
=
TOOLBOX_ITEM_NOTFOUND
;
mnCurItemId
=
0
;
mnCurItemId
=
0
;
...
@@ -4059,21 +4053,25 @@ void ToolBox::Tracking( const TrackingEvent& rTEvt )
...
@@ -4059,21 +4053,25 @@ void ToolBox::Tracking( const TrackingEvent& rTEvt )
DockingWindow
::
Tracking
(
rTEvt
);
DockingWindow
::
Tracking
(
rTEvt
);
}
}
void
ToolBox
::
InvalidateItem
(
sal_uInt16
nPosition
,
sal_uInt16
nHighlight
,
bool
bPaint
,
bool
bLayout
)
void
ToolBox
::
InvalidateItem
(
sal_uInt16
nPosition
)
{
{
//ImplToolItem* pItem = &mpData->m_aItems[nPosition];
ImplToolItem
*
pItem
=
&
mpData
->
m_aItems
[
nPosition
];
//Invalidate(pItem->maRect);
Invalidate
(
pItem
->
maRect
);
ImplDrawItem
(
*
this
,
nPosition
,
nHighlight
,
bPaint
,
bLayout
);
}
}
void
ToolBox
::
InvalidateMenuButton
(
bool
bHighlight
)
void
ToolBox
::
InvalidateMenuButton
()
{
{
ImplDrawMenuButton
(
*
this
,
bHighlight
);
if
(
!
mpData
->
maMenubuttonItem
.
maRect
.
IsEmpty
())
Invalidate
(
mpData
->
maMenubuttonItem
.
maRect
);
}
}
void
ToolBox
::
InvalidateSpin
(
bool
bUpperIn
,
bool
bLowerIn
)
void
ToolBox
::
InvalidateSpin
(
bool
bUpperIn
,
bool
bLowerIn
)
{
{
ImplDrawSpin
(
*
this
,
bUpperIn
,
bLowerIn
);
if
(
bUpperIn
&&
!
maUpperRect
.
IsEmpty
())
Invalidate
(
maUpperRect
);
if
(
bLowerIn
&&
!
maLowerRect
.
IsEmpty
())
Invalidate
(
maLowerRect
);
}
}
void
ToolBox
::
Paint
(
vcl
::
RenderContext
&
rRenderContext
,
const
Rectangle
&
rPaintRect
)
void
ToolBox
::
Paint
(
vcl
::
RenderContext
&
rRenderContext
,
const
Rectangle
&
rPaintRect
)
...
@@ -5378,7 +5376,7 @@ void ToolBox::ImplChangeHighlight( ImplToolItem* pItem, bool bNoGrabFocus )
...
@@ -5378,7 +5376,7 @@ void ToolBox::ImplChangeHighlight( ImplToolItem* pItem, bool bNoGrabFocus )
// which will in turn ImplShowFocus again
// which will in turn ImplShowFocus again
// set mnHighItemId to 0 already to prevent this hen/egg problem
// set mnHighItemId to 0 already to prevent this hen/egg problem
mnHighItemId
=
0
;
mnHighItemId
=
0
;
InvalidateItem
(
nPos
,
0
);
InvalidateItem
(
nPos
);
CallEventListeners
(
VCLEVENT_TOOLBOX_HIGHLIGHTOFF
,
reinterpret_cast
<
void
*
>
(
nPos
)
);
CallEventListeners
(
VCLEVENT_TOOLBOX_HIGHLIGHTOFF
,
reinterpret_cast
<
void
*
>
(
nPos
)
);
}
}
...
@@ -5413,7 +5411,7 @@ void ToolBox::ImplChangeHighlight( ImplToolItem* pItem, bool bNoGrabFocus )
...
@@ -5413,7 +5411,7 @@ void ToolBox::ImplChangeHighlight( ImplToolItem* pItem, bool bNoGrabFocus )
}
}
mnHighItemId
=
pItem
->
mnId
;
mnHighItemId
=
pItem
->
mnId
;
InvalidateItem
(
aPos
,
2
);
// always use shadow effect (2)
InvalidateItem
(
aPos
);
if
(
mbSelection
)
if
(
mbSelection
)
mnCurPos
=
aPos
;
mnCurPos
=
aPos
;
...
@@ -5467,7 +5465,7 @@ bool ToolBox::ImplChangeHighlightUpDn( bool bUp, bool bNoCycle )
...
@@ -5467,7 +5465,7 @@ bool ToolBox::ImplChangeHighlightUpDn( bool bUp, bool bNoCycle )
break
;
break
;
}
}
}
}
InvalidateMenuButton
(
false
);
InvalidateMenuButton
();
ImplChangeHighlight
(
pItem
);
ImplChangeHighlight
(
pItem
);
}
}
else
else
...
@@ -5482,7 +5480,7 @@ bool ToolBox::ImplChangeHighlightUpDn( bool bUp, bool bNoCycle )
...
@@ -5482,7 +5480,7 @@ bool ToolBox::ImplChangeHighlightUpDn( bool bUp, bool bNoCycle )
}
}
if
(
it
!=
mpData
->
m_aItems
.
end
()
)
if
(
it
!=
mpData
->
m_aItems
.
end
()
)
{
{
InvalidateMenuButton
(
false
);
InvalidateMenuButton
();
ImplChangeHighlight
(
&
(
*
it
)
);
ImplChangeHighlight
(
&
(
*
it
)
);
}
}
}
}
...
@@ -5504,7 +5502,7 @@ bool ToolBox::ImplChangeHighlightUpDn( bool bUp, bool bNoCycle )
...
@@ -5504,7 +5502,7 @@ bool ToolBox::ImplChangeHighlightUpDn( bool bUp, bool bNoCycle )
if
(
(
it
!=
mpData
->
m_aItems
.
end
()
&&
&
(
*
it
)
==
ImplGetFirstClippedItem
(
this
))
&&
IsMenuEnabled
()
)
if
(
(
it
!=
mpData
->
m_aItems
.
end
()
&&
&
(
*
it
)
==
ImplGetFirstClippedItem
(
this
))
&&
IsMenuEnabled
()
)
{
{
ImplChangeHighlight
(
NULL
);
ImplChangeHighlight
(
NULL
);
InvalidateMenuButton
(
true
);
InvalidateMenuButton
();
}
}
else
else
ImplChangeHighlight
(
(
it
!=
mpData
->
m_aItems
.
end
())
?
&
(
*
it
)
:
NULL
);
ImplChangeHighlight
(
(
it
!=
mpData
->
m_aItems
.
end
())
?
&
(
*
it
)
:
NULL
);
...
@@ -5518,7 +5516,7 @@ bool ToolBox::ImplChangeHighlightUpDn( bool bUp, bool bNoCycle )
...
@@ -5518,7 +5516,7 @@ bool ToolBox::ImplChangeHighlightUpDn( bool bUp, bool bNoCycle )
if
(
IsMenuEnabled
()
&&
!
ImplIsFloatingMode
()
)
if
(
IsMenuEnabled
()
&&
!
ImplIsFloatingMode
()
)
{
{
ImplChangeHighlight
(
NULL
);
ImplChangeHighlight
(
NULL
);
InvalidateMenuButton
(
true
);
InvalidateMenuButton
();
}
}
else
else
{
{
...
@@ -5558,7 +5556,7 @@ bool ToolBox::ImplChangeHighlightUpDn( bool bUp, bool bNoCycle )
...
@@ -5558,7 +5556,7 @@ bool ToolBox::ImplChangeHighlightUpDn( bool bUp, bool bNoCycle )
if
(
IsMenuEnabled
()
&&
!
ImplIsFloatingMode
()
)
if
(
IsMenuEnabled
()
&&
!
ImplIsFloatingMode
()
)
{
{
ImplChangeHighlight
(
NULL
);
ImplChangeHighlight
(
NULL
);
InvalidateMenuButton
(
true
);
InvalidateMenuButton
();
return
true
;
return
true
;
}
}
else
else
...
@@ -5576,7 +5574,7 @@ bool ToolBox::ImplChangeHighlightUpDn( bool bUp, bool bNoCycle )
...
@@ -5576,7 +5574,7 @@ bool ToolBox::ImplChangeHighlightUpDn( bool bUp, bool bNoCycle )
if
(
IsMenuEnabled
()
&&
!
ImplIsFloatingMode
()
)
if
(
IsMenuEnabled
()
&&
!
ImplIsFloatingMode
()
)
{
{
ImplChangeHighlight
(
NULL
);
ImplChangeHighlight
(
NULL
);
InvalidateMenuButton
(
true
);
InvalidateMenuButton
();
return
true
;
return
true
;
}
}
else
else
...
@@ -5595,7 +5593,7 @@ bool ToolBox::ImplChangeHighlightUpDn( bool bUp, bool bNoCycle )
...
@@ -5595,7 +5593,7 @@ bool ToolBox::ImplChangeHighlightUpDn( bool bUp, bool bNoCycle )
{
{
// select the menu button if a clipped item would be selected
// select the menu button if a clipped item would be selected
ImplChangeHighlight
(
NULL
);
ImplChangeHighlight
(
NULL
);
InvalidateMenuButton
(
true
);
InvalidateMenuButton
();
}
}
else
if
(
i
!=
nCount
)
else
if
(
i
!=
nCount
)
ImplChangeHighlight
(
pToolItem
);
ImplChangeHighlight
(
pToolItem
);
...
@@ -5635,7 +5633,7 @@ void ToolBox::ImplHideFocus()
...
@@ -5635,7 +5633,7 @@ void ToolBox::ImplHideFocus()
if
(
mpData
&&
mpData
->
mbMenubuttonSelected
)
if
(
mpData
&&
mpData
->
mbMenubuttonSelected
)
{
{
// remove highlight from menubutton
// remove highlight from menubutton
InvalidateMenuButton
(
false
);
InvalidateMenuButton
();
}
}
}
}
...
...
vcl/source/window/toolbox2.cxx
Dosyayı görüntüle @
9c9db856
...
@@ -1367,7 +1367,7 @@ void ToolBox::SetItemDown( sal_uInt16 nItemId, bool bDown, bool bRelease )
...
@@ -1367,7 +1367,7 @@ void ToolBox::SetItemDown( sal_uInt16 nItemId, bool bDown, bool bRelease )
if
(
nPos
!=
mnCurPos
)
if
(
nPos
!=
mnCurPos
)
{
{
mnCurPos
=
nPos
;
mnCurPos
=
nPos
;
InvalidateItem
(
mnCurPos
,
1
);
InvalidateItem
(
mnCurPos
);
Flush
();
Flush
();
}
}
}
}
...
@@ -1676,7 +1676,7 @@ void ToolBox::ImplFillLayoutData() const
...
@@ -1676,7 +1676,7 @@ void ToolBox::ImplFillLayoutData() const
// only draw, if the rectangle is within PaintRectangle
// only draw, if the rectangle is within PaintRectangle
if
(
!
pItem
->
maRect
.
IsEmpty
())
if
(
!
pItem
->
maRect
.
IsEmpty
())
const_cast
<
ToolBox
*>
(
this
)
->
InvalidateItem
(
i
,
0
,
false
,
true
);
const_cast
<
ToolBox
*>
(
this
)
->
InvalidateItem
(
i
);
}
}
}
}
...
...
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