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
641154c2
Kaydet (Commit)
641154c2
authored
Haz 27, 2014
tarafından
Caolán McNamara
Dosyalara gözat
Seçenekler
Dosyalara Gözat
İndir
Eposta Yamaları
Sade Fark
Resolves: fdo#65634 improve wheel-scrolling sidebar panels
Change-Id: I213d85a1e2bbd2377f6f0326433ddd57dc346721
üst
e48a2339
Hide whitespace changes
Inline
Side-by-side
Showing
3 changed files
with
29 additions
and
36 deletions
+29
-36
Deck.cxx
sfx2/source/sidebar/Deck.cxx
+2
-32
Deck.hxx
sfx2/source/sidebar/Deck.hxx
+1
-4
winproc.cxx
vcl/source/window/winproc.cxx
+26
-0
No files found.
sfx2/source/sidebar/Deck.cxx
Dosyayı görüntüle @
641154c2
...
...
@@ -190,9 +190,6 @@ void Deck::DataChanged (const DataChangedEvent& rEvent)
RequestLayout
();
}
bool
Deck
::
Notify
(
NotifyEvent
&
rEvent
)
{
if
(
rEvent
.
GetType
()
==
EVENT_COMMAND
)
...
...
@@ -202,7 +199,7 @@ bool Deck::Notify (NotifyEvent& rEvent)
switch
(
pCommandEvent
->
GetCommand
())
{
case
COMMAND_WHEEL
:
return
ProcessWheelEvent
(
pCommandEvent
,
rEvent
);
return
ProcessWheelEvent
(
pCommandEvent
);
default
:
break
;
...
...
@@ -212,24 +209,13 @@ bool Deck::Notify (NotifyEvent& rEvent)
return
Window
::
Notify
(
rEvent
);
}
bool
Deck
::
ProcessWheelEvent
(
CommandEvent
*
pCommandEvent
,
NotifyEvent
&
rEvent
)
bool
Deck
::
ProcessWheelEvent
(
CommandEvent
*
pCommandEvent
)
{
if
(
!
mpVerticalScrollBar
)
return
false
;
if
(
!
mpVerticalScrollBar
->
IsVisible
())
return
false
;
// Ignore all wheel commands from outside the vertical scroll bar.
// Otherwise after a scroll we might land on a spin field and
// subsequent wheel events would change the value of that control.
if
(
rEvent
.
GetWindow
()
!=
mpVerticalScrollBar
.
get
())
return
true
;
// Get the wheel data and check that it describes a valid vertical
// scroll.
const
CommandWheelData
*
pData
=
pCommandEvent
->
GetWheelData
();
...
...
@@ -246,9 +232,6 @@ bool Deck::ProcessWheelEvent (
return
true
;
}
void
Deck
::
SetPanels
(
const
SharedPanelContainer
&
rPanels
)
{
maPanels
=
rPanels
;
...
...
@@ -256,13 +239,6 @@ void Deck::SetPanels (const SharedPanelContainer& rPanels)
RequestLayout
();
}
void
Deck
::
RequestLayout
(
void
)
{
mnMinimalWidth
=
0
;
...
...
@@ -278,17 +254,11 @@ void Deck::RequestLayout (void)
*
mpVerticalScrollBar
);
}
::
Window
*
Deck
::
GetPanelParentWindow
(
void
)
{
return
mpScrollContainer
.
get
();
}
void
Deck
::
ShowPanel
(
const
Panel
&
rPanel
)
{
if
(
mpVerticalScrollBar
&&
mpVerticalScrollBar
->
IsVisible
())
...
...
sfx2/source/sidebar/Deck.hxx
Dosyayı görüntüle @
641154c2
...
...
@@ -100,12 +100,9 @@ private:
::
boost
::
scoped_ptr
<
ScrollBar
>
mpVerticalScrollBar
;
DECL_LINK
(
HandleVerticalScrollBarChange
,
void
*
);
bool
ProcessWheelEvent
(
CommandEvent
*
pCommandEvent
,
NotifyEvent
&
rEvent
);
bool
ProcessWheelEvent
(
CommandEvent
*
pCommandEvent
);
};
}
}
// end of namespace sfx2::sidebar
#endif
...
...
vcl/source/window/winproc.cxx
Dosyayı görüntüle @
641154c2
...
...
@@ -1366,8 +1366,22 @@ static bool acceptableWheelScrollTarget(const Window *pMouseWindow)
return
(
pMouseWindow
&&
pMouseWindow
->
IsInputEnabled
()
&&
!
pMouseWindow
->
IsInModalMode
());
}
//If the last event at the same absolute screen position was handled by a
//different window then reuse that window if the event occurs within 1/2 a
//second, i.e. so scrolling down something like the calc sidebar that contains
//widgets that respond to wheel events will continue to send the event to the
//scrolling widget in favour of the widget that happens to end up under the
//mouse.
static
bool
shouldReusePreviousMouseWindow
(
const
SalWheelMouseEvent
&
rPrevEvt
,
const
SalWheelMouseEvent
&
rEvt
)
{
return
(
rEvt
.
mnX
==
rPrevEvt
.
mnX
&&
rEvt
.
mnY
==
rPrevEvt
.
mnY
&&
rEvt
.
mnTime
-
rPrevEvt
.
mnTime
<
500
/*ms*/
);
}
static
bool
ImplHandleWheelEvent
(
Window
*
pWindow
,
const
SalWheelMouseEvent
&
rEvt
,
bool
scaleDirectly
=
false
)
{
static
SalWheelMouseEvent
aPreviousEvent
;
static
Window
*
pPreviousWindow
;
ImplDelData
aDogTag
(
pWindow
);
ImplSVData
*
pSVData
=
ImplGetSVData
();
...
...
@@ -1431,6 +1445,16 @@ static bool ImplHandleWheelEvent( Window* pWindow, const SalWheelMouseEvent& rEv
pMouseWindow
=
pMouseWindow
->
GetParent
();
}
// avoid the problem that scrolling via wheel to this point brings a widget
// under the mouse that also accepts wheel commands, so stick with the old
// widget if the time gap is very small
if
(
shouldReusePreviousMouseWindow
(
aPreviousEvent
,
rEvt
)
&&
acceptableWheelScrollTarget
(
pPreviousWindow
))
{
pMouseWindow
=
pPreviousWindow
;
}
aPreviousEvent
=
rEvt
;
if
(
acceptableWheelScrollTarget
(
pMouseWindow
)
&&
pMouseWindow
->
IsEnabled
())
{
// transform coordinates to float window frame coordinates
...
...
@@ -1441,6 +1465,8 @@ static bool ImplHandleWheelEvent( Window* pWindow, const SalWheelMouseEvent& rEv
bRet
=
ImplCallWheelCommand
(
pMouseWindow
,
aRelMousePos
,
&
aWheelData
);
}
pPreviousWindow
=
!
bRet
?
pMouseWindow
:
NULL
;
// if the command was not handled try the focus window
if
(
bRet
)
{
...
...
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