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
37bb1079
Kaydet (Commit)
37bb1079
authored
Nis 27, 2015
tarafından
Caolán McNamara
Dosyalara gözat
Seçenekler
Dosyalara Gözat
İndir
Eposta Yamaları
Sade Fark
gtk3: hive the borders and padding calc off into a standalone
Change-Id: I0890a7d8c50b8646782bfc4358aa7c2f106dc22d
üst
4de9e22c
Hide whitespace changes
Inline
Side-by-side
Showing
1 changed file
with
23 additions
and
18 deletions
+23
-18
gtk3salnativewidgets-gtk.cxx
vcl/unx/gtk3/gdi/gtk3salnativewidgets-gtk.cxx
+23
-18
No files found.
vcl/unx/gtk3/gdi/gtk3salnativewidgets-gtk.cxx
Dosyayı görüntüle @
37bb1079
...
@@ -979,6 +979,28 @@ bool GtkSalGraphics::drawNativeControl( ControlType nType, ControlPart nPart, co
...
@@ -979,6 +979,28 @@ bool GtkSalGraphics::drawNativeControl( ControlType nType, ControlPart nPart, co
return
true
;
return
true
;
}
}
Rectangle
AdjustRectForTextBordersPadding
(
GtkStyleContext
*
pStyle
,
long
nTextHeight
,
const
Rectangle
&
rControlRegion
)
{
gtk_style_context_save
(
pStyle
);
gtk_style_context_add_class
(
pStyle
,
GTK_STYLE_CLASS_ENTRY
);
GtkBorder
border
;
gtk_style_context_get_border
(
pStyle
,
GTK_STATE_FLAG_NORMAL
,
&
border
);
GtkBorder
padding
;
gtk_style_context_get_padding
(
pStyle
,
GTK_STATE_FLAG_NORMAL
,
&
padding
);
gint
nWidgetHeight
=
nTextHeight
+
padding
.
top
+
padding
.
bottom
+
border
.
top
+
border
.
bottom
;
nWidgetHeight
=
std
::
max
<
gint
>
(
nWidgetHeight
,
rControlRegion
.
GetHeight
());
Rectangle
aEditRect
(
rControlRegion
.
TopLeft
(),
Size
(
rControlRegion
.
GetWidth
(),
nWidgetHeight
));
gtk_style_context_restore
(
pStyle
);
return
aEditRect
;
}
bool
GtkSalGraphics
::
getNativeControlRegion
(
ControlType
nType
,
ControlPart
nPart
,
const
Rectangle
&
rControlRegion
,
ControlState
,
bool
GtkSalGraphics
::
getNativeControlRegion
(
ControlType
nType
,
ControlPart
nPart
,
const
Rectangle
&
rControlRegion
,
ControlState
,
const
ImplControlValue
&
rValue
,
const
OUString
&
,
const
ImplControlValue
&
rValue
,
const
OUString
&
,
Rectangle
&
rNativeBoundingRegion
,
Rectangle
&
rNativeContentRegion
)
Rectangle
&
rNativeBoundingRegion
,
Rectangle
&
rNativeContentRegion
)
...
@@ -1071,24 +1093,7 @@ bool GtkSalGraphics::getNativeControlRegion( ControlType nType, ControlPart nPar
...
@@ -1071,24 +1093,7 @@ bool GtkSalGraphics::getNativeControlRegion( ControlType nType, ControlPart nPar
}
}
else
if
((
nType
==
CTRL_EDITBOX
||
nType
==
CTRL_LISTBOX
||
nType
==
CTRL_COMBOBOX
)
&&
nPart
==
PART_ENTIRE_CONTROL
)
else
if
((
nType
==
CTRL_EDITBOX
||
nType
==
CTRL_LISTBOX
||
nType
==
CTRL_COMBOBOX
)
&&
nPart
==
PART_ENTIRE_CONTROL
)
{
{
gtk_style_context_save
(
mpEntryStyle
);
aEditRect
=
AdjustRectForTextBordersPadding
(
mpEntryStyle
,
rValue
.
getNumericVal
(),
rControlRegion
);
gtk_style_context_add_class
(
mpEntryStyle
,
GTK_STYLE_CLASS_ENTRY
);
GtkBorder
border
;
gtk_style_context_get_border
(
mpEntryStyle
,
GTK_STATE_FLAG_NORMAL
,
&
border
);
GtkBorder
padding
;
gtk_style_context_get_padding
(
mpEntryStyle
,
GTK_STATE_FLAG_NORMAL
,
&
padding
);
auto
nTextHeight
=
rValue
.
getNumericVal
();
gint
nWidgetHeight
=
nTextHeight
+
padding
.
top
+
padding
.
bottom
+
border
.
top
+
border
.
bottom
;
nWidgetHeight
=
std
::
max
<
gint
>
(
nWidgetHeight
,
rControlRegion
.
GetHeight
());
aEditRect
=
Rectangle
(
rControlRegion
.
TopLeft
(),
Size
(
rControlRegion
.
GetWidth
(),
nWidgetHeight
));
gtk_style_context_restore
(
mpEntryStyle
);
}
}
else
else
{
{
...
...
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