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
681294d5
Kaydet (Commit)
681294d5
authored
Şub 17, 2016
tarafından
Caolán McNamara
Dosyalara gözat
Seçenekler
Dosyalara Gözat
İndir
Eposta Yamaları
Sade Fark
gtk3: use native GtkPopover for calc formula prompt, etc
Change-Id: I9aa7e977228780b6273daa03be5e872342414437
üst
7decc419
Hide whitespace changes
Inline
Side-by-side
Showing
15 changed files
with
166 additions
and
68 deletions
+166
-68
help.hxx
include/vcl/help.hxx
+10
-9
inputhdl.cxx
sc/source/ui/app/inputhdl.cxx
+6
-8
inputwin.cxx
sc/source/ui/app/inputwin.cxx
+5
-2
tabview4.cxx
sc/source/ui/view/tabview4.cxx
+4
-2
SlsToolTip.cxx
sd/source/ui/slidesorter/view/SlsToolTip.cxx
+3
-2
viewoverlaymanager.cxx
sd/source/ui/view/viewoverlaymanager.cxx
+2
-8
datwin.cxx
svtools/source/brwbox/datwin.cxx
+2
-9
datwin.hxx
svtools/source/brwbox/datwin.hxx
+0
-2
tabledatawindow.cxx
svtools/source/table/tabledatawindow.cxx
+2
-14
tabledatawindow.hxx
svtools/source/table/tabledatawindow.hxx
+0
-1
edtwin.cxx
sw/source/uibase/docvw/edtwin.cxx
+6
-3
salframe.hxx
vcl/inc/salframe.hxx
+20
-1
gtkframe.hxx
vcl/inc/unx/gtk/gtkframe.hxx
+3
-0
help.cxx
vcl/source/app/help.cxx
+27
-7
gtk3gtkframe.cxx
vcl/unx/gtk3/gtk3gtkframe.cxx
+76
-0
No files found.
include/vcl/help.hxx
Dosyayı görüntüle @
681294d5
...
...
@@ -43,7 +43,7 @@ enum class QuickHelpFlags
CtrlText
=
0x0040
,
/// no delay when opening the quick help. Applies to ShowBallon and ShowQuickHelp
NoDelay
=
0x0080
,
/// force balloon-style in Show
Tip
/// force balloon-style in Show
Popover
TipStyleBalloon
=
0x0100
,
NoEvadePointer
=
0x0200
,
BiDiRtl
=
0x0400
,
...
...
@@ -100,14 +100,15 @@ public:
static
void
HideBalloonAndQuickHelp
();
static
sal_uLong
ShowTip
(
vcl
::
Window
*
pParent
,
const
Rectangle
&
rScreenRect
,
const
OUString
&
rText
,
QuickHelpFlags
nStyle
=
QuickHelpFlags
::
NONE
);
static
void
UpdateTip
(
sal_uLong
nId
,
vcl
::
Window
*
pParent
,
const
Rectangle
&
rScreenRect
,
const
OUString
&
rText
);
static
void
HideTip
(
sal_uLong
nId
);
static
sal_uLong
ShowPopover
(
vcl
::
Window
*
pParent
,
const
Rectangle
&
rScreenRect
,
const
OUString
&
rText
,
QuickHelpFlags
nStyle
=
QuickHelpFlags
::
NONE
);
static
void
UpdatePopover
(
sal_uLong
nId
,
vcl
::
Window
*
pParent
,
const
Rectangle
&
rScreenRect
,
const
OUString
&
rText
);
static
void
HidePopover
(
vcl
::
Window
*
pParent
,
sal_uLong
nId
);
};
#endif // INCLUDED_VCL_HELP_HXX
...
...
sc/source/ui/app/inputhdl.cxx
Dosyayı görüntüle @
681294d5
...
...
@@ -868,9 +868,8 @@ void ScInputHandler::HideTip()
{
if
(
nTipVisible
)
{
if
(
pTipVisibleParent
)
pTipVisibleParent
->
RemoveEventListener
(
LINK
(
this
,
ScInputHandler
,
ShowHideTipVisibleParentListener
)
);
Help
::
HideTip
(
nTipVisible
);
pTipVisibleParent
->
RemoveEventListener
(
LINK
(
this
,
ScInputHandler
,
ShowHideTipVisibleParentListener
)
);
Help
::
HidePopover
(
pTipVisibleParent
,
nTipVisible
);
nTipVisible
=
0
;
pTipVisibleParent
=
nullptr
;
}
...
...
@@ -880,9 +879,8 @@ void ScInputHandler::HideTipBelow()
{
if
(
nTipVisibleSec
)
{
if
(
pTipVisibleSecParent
)
pTipVisibleSecParent
->
RemoveEventListener
(
LINK
(
this
,
ScInputHandler
,
ShowHideTipVisibleSecParentListener
)
);
Help
::
HideTip
(
nTipVisibleSec
);
pTipVisibleSecParent
->
RemoveEventListener
(
LINK
(
this
,
ScInputHandler
,
ShowHideTipVisibleSecParentListener
)
);
Help
::
HidePopover
(
pTipVisibleSecParent
,
nTipVisibleSec
);
nTipVisibleSec
=
0
;
pTipVisibleSecParent
=
nullptr
;
}
...
...
@@ -1082,7 +1080,7 @@ void ScInputHandler::ShowTip( const OUString& rText )
Rectangle
aRect
(
aPos
,
aPos
);
QuickHelpFlags
nAlign
=
QuickHelpFlags
::
Left
|
QuickHelpFlags
::
Bottom
;
nTipVisible
=
Help
::
Show
Tip
(
pTipVisibleParent
,
aRect
,
rText
,
nAlign
);
nTipVisible
=
Help
::
Show
Popover
(
pTipVisibleParent
,
aRect
,
rText
,
nAlign
);
pTipVisibleParent
->
AddEventListener
(
LINK
(
this
,
ScInputHandler
,
ShowHideTipVisibleParentListener
)
);
}
}
...
...
@@ -1106,7 +1104,7 @@ void ScInputHandler::ShowTipBelow( const OUString& rText )
aPos
=
pTipVisibleSecParent
->
OutputToScreenPixel
(
aPos
);
Rectangle
aRect
(
aPos
,
aPos
);
QuickHelpFlags
nAlign
=
QuickHelpFlags
::
Left
|
QuickHelpFlags
::
Top
|
QuickHelpFlags
::
NoEvadePointer
;
nTipVisibleSec
=
Help
::
Show
Tip
(
pTipVisibleSecParent
,
aRect
,
rText
,
nAlign
);
nTipVisibleSec
=
Help
::
Show
Popover
(
pTipVisibleSecParent
,
aRect
,
rText
,
nAlign
);
pTipVisibleSecParent
->
AddEventListener
(
LINK
(
this
,
ScInputHandler
,
ShowHideTipVisibleSecParentListener
)
);
}
}
...
...
sc/source/ui/app/inputwin.cxx
Dosyayı görüntüle @
681294d5
...
...
@@ -2066,7 +2066,10 @@ void ScPosWnd::HideTip()
{
if
(
nTipVisible
)
{
Help
::
HideTip
(
nTipVisible
);
vcl
::
Window
*
pWin
=
GetSubEdit
();
if
(
!
pWin
)
pWin
=
this
;
Help
::
HidePopover
(
pWin
,
nTipVisible
);
nTipVisible
=
0
;
}
}
...
...
@@ -2174,7 +2177,7 @@ void ScPosWnd::Modify()
OUString
aText
=
ScGlobal
::
GetRscString
(
nStrId
);
QuickHelpFlags
nAlign
=
QuickHelpFlags
::
Left
|
QuickHelpFlags
::
Bottom
;
nTipVisible
=
Help
::
Show
Tip
(
pWin
,
aRect
,
aText
,
nAlign
);
nTipVisible
=
Help
::
Show
Popover
(
pWin
,
aRect
,
aText
,
nAlign
);
}
}
}
...
...
sc/source/ui/view/tabview4.cxx
Dosyayı görüntüle @
681294d5
...
...
@@ -37,7 +37,9 @@ void ScTabView::HideTip()
{
if
(
nTipVisible
)
{
Help
::
HideTip
(
nTipVisible
);
ScSplitPos
eWhich
=
aViewData
.
GetActivePart
();
vcl
::
Window
*
pWin
=
pGridWin
[
eWhich
];
Help
::
HidePopover
(
pWin
,
nTipVisible
);
nTipVisible
=
0
;
}
}
...
...
@@ -90,7 +92,7 @@ void ScTabView::ShowRefTip()
//! Test, ob geaendert ??
HideTip
();
nTipVisible
=
Help
::
Show
Tip
(
pWin
,
aRect
,
aHelp
,
nFlags
);
nTipVisible
=
Help
::
Show
Popover
(
pWin
,
aRect
,
aHelp
,
nFlags
);
bDone
=
true
;
}
}
...
...
sd/source/ui/slidesorter/view/SlsToolTip.cxx
Dosyayı görüntüle @
681294d5
...
...
@@ -134,7 +134,7 @@ void ToolTip::DoShow()
// the preview). Therefore we use a little trick and place the tool
// tip at the top of a rectangle that is placed below the preview.
aBox
.
Move
(
aOffset
.
X
(),
aOffset
.
Y
()
+
aBox
.
GetHeight
()
+
3
);
mnHelpWindowHandle
=
Help
::
Show
Tip
(
mnHelpWindowHandle
=
Help
::
Show
Popover
(
pWindow
,
aBox
,
msCurrentHelpText
,
...
...
@@ -146,7 +146,8 @@ bool ToolTip::Hide()
{
if
(
mnHelpWindowHandle
>
0
)
{
Help
::
HideTip
(
mnHelpWindowHandle
);
sd
::
Window
*
pWindow
(
mrSlideSorter
.
GetContentWindow
());
Help
::
HidePopover
(
pWindow
,
mnHelpWindowHandle
);
mnHelpWindowHandle
=
0
;
return
true
;
}
...
...
sd/source/ui/view/viewoverlaymanager.cxx
Dosyayı görüntüle @
681294d5
...
...
@@ -146,7 +146,6 @@ private:
int
mnHighlightId
;
Size
maImageSize
;
sal_uLong
mnTip
;
};
ImageButtonHdl
::
ImageButtonHdl
(
const
SmartTagReference
&
xTag
/*, sal_uInt16 nSID, const Image& rImage, const Image& rImageMO*/
,
const
Point
&
rPnt
)
...
...
@@ -154,7 +153,6 @@ ImageButtonHdl::ImageButtonHdl( const SmartTagReference& xTag /*, sal_uInt16 nSI
,
mxTag
(
dynamic_cast
<
ChangePlaceholderTag
*
>
(
xTag
.
get
()
)
)
,
mnHighlightId
(
-
1
)
,
maImageSize
(
42
,
42
)
,
mnTip
(
0
)
{
}
...
...
@@ -165,11 +163,7 @@ ImageButtonHdl::~ImageButtonHdl()
void
ImageButtonHdl
::
HideTip
()
{
if
(
mnTip
)
{
Help
::
HideTip
(
mnTip
);
mnTip
=
0
;
}
Help
::
HideBalloonAndQuickHelp
();
}
void
ImageButtonHdl
::
onMouseEnter
(
const
MouseEvent
&
rMEvt
)
...
...
@@ -201,7 +195,7 @@ void ImageButtonHdl::onMouseEnter(const MouseEvent& rMEvt)
OUString
aHelpText
(
aResId
);
Rectangle
aScreenRect
(
pDev
->
LogicToPixel
(
GetPos
()
),
maImageSize
);
mnTip
=
Help
::
ShowTip
(
static_cast
<
vcl
::
Window
*
>
(
pHdlList
->
GetView
()
->
GetFirstOutputDevice
()
),
aScreenRect
,
aHelpText
)
;
Help
::
ShowQuickHelp
(
static_cast
<
vcl
::
Window
*
>
(
pHdlList
->
GetView
()
->
GetFirstOutputDevice
()
),
aScreenRect
,
aHelpText
)
;
}
Touch
();
}
...
...
svtools/source/brwbox/datwin.cxx
Dosyayı görüntüle @
681294d5
...
...
@@ -713,24 +713,17 @@ void BrowserScrollBar::Tracking( const TrackingEvent& rTEvt )
aTip
+=
OUString
::
number
(
GetRangeMax
());
Rectangle
aRect
(
GetPointerPosPixel
(),
Size
(
GetTextWidth
(
aTip
),
GetTextHeight
()));
if
(
_nTip
)
Help
::
UpdateTip
(
_nTip
,
this
,
aRect
,
aTip
);
else
_nTip
=
Help
::
ShowTip
(
this
,
aRect
,
aTip
);
Help
::
ShowQuickHelp
(
this
,
aRect
,
aTip
);
_nLastPos
=
nPos
;
}
ScrollBar
::
Tracking
(
rTEvt
);
}
void
BrowserScrollBar
::
EndScroll
()
{
if
(
_nTip
)
Help
::
HideTip
(
_nTip
);
_nTip
=
0
;
Help
::
HideBalloonAndQuickHelp
();
ScrollBar
::
EndScroll
();
}
/* vim:set shiftwidth=4 softtabstop=4 expandtab: */
svtools/source/brwbox/datwin.hxx
Dosyayı görüntüle @
681294d5
...
...
@@ -178,7 +178,6 @@ protected:
class
BrowserScrollBar
:
public
ScrollBar
{
sal_uLong
_nTip
;
sal_uLong
_nLastPos
;
VclPtr
<
BrowserDataWin
>
_pDataWin
;
...
...
@@ -186,7 +185,6 @@ public:
BrowserScrollBar
(
vcl
::
Window
*
pParent
,
WinBits
nStyle
,
BrowserDataWin
*
pDataWin
)
:
ScrollBar
(
pParent
,
nStyle
),
_nTip
(
0
),
_nLastPos
(
ULONG_MAX
),
_pDataWin
(
pDataWin
)
{}
...
...
svtools/source/table/tabledatawindow.cxx
Dosyayı görüntüle @
681294d5
...
...
@@ -33,7 +33,6 @@ namespace svt { namespace table
TableDataWindow
::
TableDataWindow
(
TableControl_Impl
&
_rTableControl
)
:
Window
(
&
_rTableControl
.
getAntiImpl
()
)
,
m_rTableControl
(
_rTableControl
)
,
m_nTipWindowHandle
(
0
)
{
// by default, use the background as determined by the style settings
const
Color
aWindowColor
(
GetSettings
().
GetStyleSettings
().
GetFieldColor
()
);
...
...
@@ -123,12 +122,7 @@ namespace svt { namespace table
GetOutputSizePixel
()
);
if
(
m_nTipWindowHandle
)
{
Help
::
UpdateTip
(
m_nTipWindowHandle
,
this
,
aControlScreenRect
,
sHelpText
);
}
else
m_nTipWindowHandle
=
Help
::
ShowTip
(
this
,
aControlScreenRect
,
sHelpText
,
nHelpStyle
);
Help
::
ShowQuickHelp
(
this
,
aControlScreenRect
,
sHelpText
,
nHelpStyle
);
}
else
{
...
...
@@ -137,17 +131,11 @@ namespace svt { namespace table
}
}
void
TableDataWindow
::
impl_hideTipWindow
()
{
if
(
m_nTipWindowHandle
!=
0
)
{
Help
::
HideTip
(
m_nTipWindowHandle
);
m_nTipWindowHandle
=
0
;
}
Help
::
HideBalloonAndQuickHelp
();
}
void
TableDataWindow
::
MouseMove
(
const
MouseEvent
&
rMEvt
)
{
if
(
rMEvt
.
IsLeaveWindow
()
)
...
...
svtools/source/table/tabledatawindow.hxx
Dosyayı görüntüle @
681294d5
...
...
@@ -38,7 +38,6 @@ namespace svt { namespace table
private
:
TableControl_Impl
&
m_rTableControl
;
Link
<
LinkParamNone
*
,
void
>
m_aSelectHdl
;
sal_uLong
m_nTipWindowHandle
;
public
:
explicit
TableDataWindow
(
TableControl_Impl
&
_rTableControl
);
...
...
sw/source/uibase/docvw/edtwin.cxx
Dosyayı görüntüle @
681294d5
...
...
@@ -5916,9 +5916,9 @@ void QuickHelpData::Start( SwWrtShell& rSh, sal_uInt16 nWrdLen )
Point
aPt
(
rWin
.
OutputToScreenPixel
(
rWin
.
LogicToPixel
(
rSh
.
GetCharRect
().
Pos
()
)));
aPt
.
Y
()
-=
3
;
nTipId
=
Help
::
Show
Tip
(
&
rWin
,
Rectangle
(
aPt
,
Size
(
1
,
1
)),
nTipId
=
Help
::
Show
Popover
(
&
rWin
,
Rectangle
(
aPt
,
Size
(
1
,
1
)),
m_aHelpStrings
[
nCurArrPos
],
QuickHelpFlags
::
Left
|
QuickHelpFlags
::
Bottom
);
QuickHelpFlags
::
Left
|
QuickHelpFlags
::
Bottom
);
}
else
{
...
...
@@ -5951,7 +5951,10 @@ void QuickHelpData::Stop( SwWrtShell& rSh )
if
(
!
m_bIsTip
)
rSh
.
DeleteExtTextInput
(
nullptr
,
false
);
else
if
(
nTipId
)
Help
::
HideTip
(
nTipId
);
{
vcl
::
Window
&
rWin
=
rSh
.
GetView
().
GetEditWin
();
Help
::
HidePopover
(
&
rWin
,
nTipId
);
}
ClearContent
();
}
...
...
vcl/inc/salframe.hxx
Dosyayı görüntüle @
681294d5
...
...
@@ -23,6 +23,7 @@
#include "salwtype.hxx"
#include "salgeom.hxx"
#include <vcl/help.hxx>
#include <vcl/window.hxx>
// complete vcl::Window for SalFrame::CallCallback under -fsanitize=function
...
...
@@ -231,7 +232,25 @@ public:
}
// return true to indicate tooltips are shown natively, false otherwise
virtual
bool
ShowTooltip
(
const
OUString
&
/*rHelpText*/
,
const
Rectangle
&
/*rHelpArea*/
)
virtual
bool
ShowTooltip
(
const
OUString
&
/*rHelpText*/
,
const
Rectangle
&
/*rHelpArea*/
)
{
return
false
;
}
// return !0 to indicate popovers are shown natively, 0 otherwise
virtual
sal_uIntPtr
ShowPopover
(
const
OUString
&
/*rHelpText*/
,
const
Rectangle
&
/*rHelpArea*/
,
QuickHelpFlags
/*nFlags*/
)
{
return
0
;
}
// return true to indicate popovers are shown natively, false otherwise
virtual
bool
UpdatePopover
(
sal_uIntPtr
/*nId*/
,
const
OUString
&
/*rHelpText*/
,
const
Rectangle
&
/*rHelpArea*/
)
{
return
false
;
}
// return true to indicate popovers are shown natively, false otherwise
virtual
bool
HidePopover
(
sal_uIntPtr
/*nId*/
)
{
return
false
;
}
...
...
vcl/inc/unx/gtk/gtkframe.hxx
Dosyayı görüntüle @
681294d5
...
...
@@ -517,6 +517,9 @@ public:
#if GTK_CHECK_VERSION(3,0,0)
virtual
void
SetModal
(
bool
bModal
)
override
;
virtual
bool
ShowTooltip
(
const
OUString
&
rHelpText
,
const
Rectangle
&
rHelpArea
)
override
;
virtual
sal_uIntPtr
ShowPopover
(
const
OUString
&
rHelpText
,
const
Rectangle
&
rHelpArea
,
QuickHelpFlags
nFlags
)
override
;
virtual
bool
UpdatePopover
(
sal_uIntPtr
nId
,
const
OUString
&
rHelpText
,
const
Rectangle
&
rHelpArea
)
override
;
virtual
bool
HidePopover
(
sal_uIntPtr
nId
)
override
;
#endif
static
GtkSalFrame
*
getFromWindow
(
GtkWindow
*
pWindow
);
...
...
vcl/source/app/help.cxx
Dosyayı görüntüle @
681294d5
...
...
@@ -191,23 +191,37 @@ void Help::HideBalloonAndQuickHelp()
ImplDestroyHelpWindow
(
bIsVisible
);
}
sal_uIntPtr
Help
::
Show
Tip
(
vcl
::
Window
*
pParent
,
const
Rectangle
&
rScreenRect
,
const
OUString
&
rText
,
QuickHelpFlags
nStyle
)
sal_uIntPtr
Help
::
Show
Popover
(
vcl
::
Window
*
pParent
,
const
Rectangle
&
rScreenRect
,
const
OUString
&
rText
,
QuickHelpFlags
nStyle
)
{
sal_uIntPtr
nId
=
pParent
->
ImplGetFrame
()
->
ShowPopover
(
rText
,
rScreenRect
,
nStyle
);
if
(
nId
)
{
//popovers are handled natively, return early
return
nId
;
}
sal_uInt16
nHelpWinStyle
=
(
nStyle
&
QuickHelpFlags
::
TipStyleBalloon
)
?
HELPWINSTYLE_BALLOON
:
HELPWINSTYLE_QUICK
;
VclPtrInstance
<
HelpTextWindow
>
pHelpWin
(
pParent
,
rText
,
nHelpWinStyle
,
nStyle
);
sal_uIntPtr
nId
=
reinterpret_cast
<
sal_uIntPtr
>
(
pHelpWin
.
get
()
);
Update
Tip
(
nId
,
pParent
,
rScreenRect
,
rText
);
nId
=
reinterpret_cast
<
sal_uIntPtr
>
(
pHelpWin
.
get
()
);
Update
Popover
(
nId
,
pParent
,
rScreenRect
,
rText
);
pHelpWin
->
ShowHelp
(
HELPDELAY_NONE
);
return
nId
;
}
void
Help
::
UpdateTip
(
sal_uIntPtr
nId
,
vcl
::
Window
*
pParent
,
const
Rectangle
&
rScreenRect
,
const
OUString
&
rText
)
void
Help
::
UpdatePopover
(
sal_uIntPtr
nId
,
vcl
::
Window
*
pParent
,
const
Rectangle
&
rScreenRect
,
const
OUString
&
rText
)
{
if
(
pParent
->
ImplGetFrame
()
->
UpdatePopover
(
nId
,
rText
,
rScreenRect
))
{
//popovers are handled natively, return early
return
;
}
HelpTextWindow
*
pHelpWin
=
reinterpret_cast
<
HelpTextWindow
*
>
(
nId
);
ENSURE_OR_RETURN_VOID
(
pHelpWin
!=
nullptr
,
"Help::Update
Tip
: invalid ID!"
);
ENSURE_OR_RETURN_VOID
(
pHelpWin
!=
nullptr
,
"Help::Update
Popover
: invalid ID!"
);
Size
aSz
=
pHelpWin
->
CalcOutSize
();
pHelpWin
->
SetOutputSizePixel
(
aSz
);
...
...
@@ -218,8 +232,14 @@ void Help::UpdateTip( sal_uIntPtr nId, vcl::Window* pParent, const Rectangle& rS
pHelpWin
->
Invalidate
();
}
void
Help
::
Hide
Tip
(
sal_uLong
nId
)
void
Help
::
Hide
Popover
(
vcl
::
Window
*
pParent
,
sal_uLong
nId
)
{
if
(
pParent
->
ImplGetFrame
()
->
HidePopover
(
nId
))
{
//popovers are handled natively, return early
return
;
}
VclPtr
<
HelpTextWindow
>
pHelpWin
=
reinterpret_cast
<
HelpTextWindow
*>
(
nId
);
vcl
::
Window
*
pFrameWindow
=
pHelpWin
->
ImplGetFrameWindow
();
pHelpWin
->
Hide
();
...
...
vcl/unx/gtk3/gtk3gtkframe.cxx
Dosyayı görüntüle @
681294d5
...
...
@@ -2449,6 +2449,82 @@ bool GtkSalFrame::ShowTooltip(const OUString& rHelpText, const Rectangle& rHelpA
return
true
;
}
sal_uIntPtr
GtkSalFrame
::
ShowPopover
(
const
OUString
&
rHelpText
,
const
Rectangle
&
rHelpArea
,
QuickHelpFlags
nFlags
)
{
#if GTK_CHECK_VERSION(3,12,0)
GtkWidget
*
pWidget
=
gtk_popover_new
(
getMouseEventWidget
());
OString
sUTF
=
OUStringToOString
(
rHelpText
,
RTL_TEXTENCODING_UTF8
);
GtkWidget
*
pLabel
=
gtk_label_new
(
sUTF
.
getStr
());
gtk_container_add
(
GTK_CONTAINER
(
pWidget
),
pLabel
);
GdkRectangle
aRect
;
aRect
.
x
=
rHelpArea
.
Left
();
aRect
.
y
=
rHelpArea
.
Top
();
aRect
.
width
=
rHelpArea
.
GetWidth
();
aRect
.
height
=
rHelpArea
.
GetHeight
();
gtk_popover_set_pointing_to
(
GTK_POPOVER
(
pWidget
),
&
aRect
);
if
(
nFlags
&
QuickHelpFlags
::
Top
)
gtk_popover_set_position
(
GTK_POPOVER
(
pWidget
),
GTK_POS_BOTTOM
);
else
if
(
nFlags
&
QuickHelpFlags
::
Bottom
)
gtk_popover_set_position
(
GTK_POPOVER
(
pWidget
),
GTK_POS_TOP
);
else
if
(
nFlags
&
QuickHelpFlags
::
Left
)
gtk_popover_set_position
(
GTK_POPOVER
(
pWidget
),
GTK_POS_RIGHT
);
else
if
(
nFlags
&
QuickHelpFlags
::
Right
)
gtk_popover_set_position
(
GTK_POPOVER
(
pWidget
),
GTK_POS_LEFT
);
gtk_popover_set_modal
(
GTK_POPOVER
(
pWidget
),
false
);
gtk_widget_show_all
(
pWidget
);
return
reinterpret_cast
<
sal_uIntPtr
>
(
pWidget
);
#else
(
void
)
rHelpText
;
(
void
)
rHelpArea
;
(
void
)
nFlags
;
return
0
;
#endif
}
bool
GtkSalFrame
::
UpdatePopover
(
sal_uIntPtr
nId
,
const
OUString
&
rHelpText
,
const
Rectangle
&
rHelpArea
)
{
#if GTK_CHECK_VERSION(3,12,0)
GtkWidget
*
pWidget
=
reinterpret_cast
<
GtkWidget
*>
(
nId
);
GdkRectangle
aRect
;
aRect
.
x
=
rHelpArea
.
Left
();
aRect
.
y
=
rHelpArea
.
Top
();
aRect
.
width
=
rHelpArea
.
GetWidth
();
aRect
.
height
=
rHelpArea
.
GetHeight
();
gtk_popover_set_pointing_to
(
GTK_POPOVER
(
pWidget
),
&
aRect
);
GtkWidget
*
pLabel
=
gtk_bin_get_child
(
GTK_BIN
(
pWidget
));
OString
sUTF
=
OUStringToOString
(
rHelpText
,
RTL_TEXTENCODING_UTF8
);
gtk_label_set_text
(
GTK_LABEL
(
pLabel
),
sUTF
.
getStr
());
return
true
;
#else
(
void
)
nId
;
(
void
)
rHelpText
;
(
void
)
rHelpArea
;
return
false
#endif
}
bool
GtkSalFrame
::
HidePopover
(
sal_uIntPtr
nId
)
{
#if GTK_CHECK_VERSION(3,12,0)
GtkWidget
*
pWidget
=
reinterpret_cast
<
GtkWidget
*>
(
nId
);
gtk_widget_destroy
(
pWidget
);
return
true
;
#else
(
void
)
nId
;
return
false
;
#endif
}
gboolean
GtkSalFrame
::
signalButton
(
GtkWidget
*
,
GdkEventButton
*
pEvent
,
gpointer
frame
)
{
GtkSalFrame
*
pThis
=
static_cast
<
GtkSalFrame
*>
(
frame
);
...
...
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