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
63f0dbdd
Kaydet (Commit)
63f0dbdd
authored
Tem 02, 2018
tarafından
Katarina Behrens
Dosyalara gözat
Seçenekler
Dosyalara Gözat
İndir
Eposta Yamaları
Sade Fark
Draw button focus so that it doesn't obscure the actual button
Change-Id: I0df51b8dfd75dd966639d0893c379f2038c949ff
üst
dc8f347f
Hide whitespace changes
Inline
Side-by-side
Showing
2 changed files
with
33 additions
and
9 deletions
+33
-9
KDE5SalGraphics.cxx
vcl/unx/kde5/KDE5SalGraphics.cxx
+27
-9
KDE5SalGraphics.hxx
vcl/unx/kde5/KDE5SalGraphics.hxx
+6
-0
No files found.
vcl/unx/kde5/KDE5SalGraphics.cxx
Dosyayı görüntüle @
63f0dbdd
...
...
@@ -81,6 +81,7 @@ void QImage2BitmapBuffer(QImage* pImg, BitmapBuffer* pBuf)
KDE5SalGraphics
::
KDE5SalGraphics
()
:
SvpSalGraphics
()
{
initStyles
();
}
bool
KDE5SalGraphics
::
IsNativeControlSupported
(
ControlType
type
,
ControlPart
part
)
...
...
@@ -218,12 +219,6 @@ bool KDE5SalGraphics::drawNativeControl(ControlType type, ControlPart part,
case
ControlType
:
:
Tooltip
:
m_image
->
fill
(
QApplication
::
palette
().
color
(
QPalette
::
ToolTipBase
).
rgb
());
break
;
case
ControlType
:
:
Pushbutton
:
if
(
nControlState
&
ControlState
::
FOCUSED
)
m_image
->
fill
(
QApplication
::
palette
().
color
(
QPalette
::
Highlight
).
rgb
());
else
m_image
->
fill
(
QApplication
::
palette
().
color
(
QPalette
::
Button
).
rgb
());
break
;
case
ControlType
:
:
Scrollbar
:
if
((
part
==
ControlPart
::
DrawBackgroundVert
)
||
(
part
==
ControlPart
::
DrawBackgroundHorz
))
...
...
@@ -241,9 +236,21 @@ bool KDE5SalGraphics::drawNativeControl(ControlType type, ControlPart part,
if
(
type
==
ControlType
::
Pushbutton
)
{
QStyleOptionButton
option
;
draw
(
QStyle
::
CE_PushButton
,
&
option
,
m_image
.
get
(),
vclStateValue2StateFlag
(
nControlState
,
value
));
if
(
part
==
ControlPart
::
Entire
)
{
QStyleOptionButton
option
;
draw
(
QStyle
::
CE_PushButton
,
&
option
,
m_image
.
get
(),
vclStateValue2StateFlag
(
nControlState
,
value
));
}
else
if
(
part
==
ControlPart
::
Focus
)
{
QStyleOptionButton
option
;
option
.
state
=
QStyle
::
State_HasFocus
;
option
.
rect
=
m_image
->
rect
();
QPainter
painter
(
m_image
.
get
());
m_focusedButton
->
style
()
->
drawControl
(
QStyle
::
CE_PushButton
,
&
option
,
&
painter
,
m_focusedButton
.
get
());
}
}
else
if
(
type
==
ControlType
::
Menubar
)
{
...
...
@@ -991,4 +998,15 @@ bool KDE5SalGraphics::hitTestNativeControl(ControlType nType, ControlPart nPart,
return
false
;
}
void
KDE5SalGraphics
::
initStyles
()
{
// button focus
m_focusedButton
.
reset
(
new
QPushButton
());
QString
aHighlightColor
=
QApplication
::
palette
().
color
(
QPalette
::
Highlight
).
name
();
QString
focusStyleSheet
(
"background-color: rgb(0,0,0,0%); border: 1px; border-radius: 2px; "
"border-color: %1; border-style:solid;"
);
focusStyleSheet
.
replace
(
"%1"
,
aHighlightColor
);
m_focusedButton
->
setStyleSheet
(
focusStyleSheet
);
}
/* vim:set shiftwidth=4 softtabstop=4 expandtab: */
vcl/unx/kde5/KDE5SalGraphics.hxx
Dosyayı görüntüle @
63f0dbdd
...
...
@@ -25,6 +25,7 @@
#include <headless/svpgdi.hxx>
#include <QtGui/QImage>
#include <QtWidgets/QPushButton>
class
KDE5SalFrame
;
...
...
@@ -49,6 +50,11 @@ public:
std
::
unique_ptr
<
QImage
>
m_image
;
QRect
lastPopupRect
;
private
:
void
initStyles
();
std
::
unique_ptr
<
QPushButton
>
m_focusedButton
;
};
/* vim:set shiftwidth=4 softtabstop=4 expandtab: */
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