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
e88eb733
Kaydet (Commit)
e88eb733
authored
Eyl 13, 2011
tarafından
Cédric Bosdonnat
Dosyalara gözat
Seçenekler
Dosyalara Gözat
İndir
Eposta Yamaları
Sade Fark
Header/Footer: handle high contrast mode in Paint method
üst
883991e8
Show whitespace changes
Inline
Side-by-side
Showing
2 changed files
with
37 additions
and
10 deletions
+37
-10
paintfrm.cxx
sw/source/core/layout/paintfrm.cxx
+19
-7
HeaderFooterWin.cxx
sw/source/ui/docvw/HeaderFooterWin.cxx
+18
-3
No files found.
sw/source/core/layout/paintfrm.cxx
Dosyayı görüntüle @
e88eb733
...
@@ -3279,13 +3279,26 @@ drawinglayer::primitive2d::Primitive2DSequence lcl_CreateHeaderFooterSeparatorPr
...
@@ -3279,13 +3279,26 @@ drawinglayer::primitive2d::Primitive2DSequence lcl_CreateHeaderFooterSeparatorPr
const
SwPageFrm
*
pPageFrm
,
double
nLineY
)
const
SwPageFrm
*
pPageFrm
,
double
nLineY
)
{
{
// Adjust the Y-coordinate of the line to the header/footer box
// Adjust the Y-coordinate of the line to the header/footer box
drawinglayer
::
primitive2d
::
Primitive2DSequence
aSeq
(
2
);
drawinglayer
::
primitive2d
::
Primitive2DSequence
aSeq
(
1
);
basegfx
::
B2DPoint
aLeft
(
pPageFrm
->
Frm
().
Left
(),
nLineY
);
basegfx
::
B2DPoint
aLeft
(
pPageFrm
->
Frm
().
Left
(),
nLineY
);
basegfx
::
B2DPoint
aRight
(
pPageFrm
->
Frm
().
Right
(),
nLineY
);
basegfx
::
B2DPoint
aRight
(
pPageFrm
->
Frm
().
Right
(),
nLineY
);
basegfx
::
BColor
aLineColor
=
SwViewOption
::
GetHeaderFooterMarkColor
().
getBColor
();
basegfx
::
BColor
aLineColor
=
SwViewOption
::
GetHeaderFooterMarkColor
().
getBColor
();
std
::
vector
<
double
>
aStrokePattern
;
basegfx
::
B2DPolygon
aLinePolygon
;
aLinePolygon
.
append
(
aLeft
);
aLinePolygon
.
append
(
aRight
);
const
StyleSettings
&
rSettings
=
Application
::
GetSettings
().
GetStyleSettings
();
if
(
rSettings
.
GetHighContrastMode
(
)
)
{
// Only a solid line in high contrast mode
aLineColor
=
rSettings
.
GetDialogTextColor
().
getBColor
();
}
else
{
// Get a color for the contrast
// Get a color for the contrast
basegfx
::
BColor
aHslLine
=
basegfx
::
tools
::
rgb2hsl
(
aLineColor
);
basegfx
::
BColor
aHslLine
=
basegfx
::
tools
::
rgb2hsl
(
aLineColor
);
double
nLuminance
=
aHslLine
.
getZ
()
*
2.5
;
double
nLuminance
=
aHslLine
.
getZ
()
*
2.5
;
...
@@ -3297,10 +3310,6 @@ drawinglayer::primitive2d::Primitive2DSequence lcl_CreateHeaderFooterSeparatorPr
...
@@ -3297,10 +3310,6 @@ drawinglayer::primitive2d::Primitive2DSequence lcl_CreateHeaderFooterSeparatorPr
const
basegfx
::
BColor
aOtherColor
=
basegfx
::
tools
::
hsl2rgb
(
aHslLine
);
const
basegfx
::
BColor
aOtherColor
=
basegfx
::
tools
::
hsl2rgb
(
aHslLine
);
// Compute the plain line
// Compute the plain line
basegfx
::
B2DPolygon
aLinePolygon
;
aLinePolygon
.
append
(
aLeft
);
aLinePolygon
.
append
(
aRight
);
drawinglayer
::
primitive2d
::
PolygonHairlinePrimitive2D
*
pPlainLine
=
drawinglayer
::
primitive2d
::
PolygonHairlinePrimitive2D
*
pPlainLine
=
new
drawinglayer
::
primitive2d
::
PolygonHairlinePrimitive2D
(
new
drawinglayer
::
primitive2d
::
PolygonHairlinePrimitive2D
(
aLinePolygon
,
aOtherColor
);
aLinePolygon
,
aOtherColor
);
...
@@ -3309,10 +3318,12 @@ drawinglayer::primitive2d::Primitive2DSequence lcl_CreateHeaderFooterSeparatorPr
...
@@ -3309,10 +3318,12 @@ drawinglayer::primitive2d::Primitive2DSequence lcl_CreateHeaderFooterSeparatorPr
// Dashed line in twips
// Dashed line in twips
std
::
vector
<
double
>
aStrokePattern
;
aStrokePattern
.
push_back
(
40
);
aStrokePattern
.
push_back
(
40
);
aStrokePattern
.
push_back
(
40
);
aStrokePattern
.
push_back
(
40
);
aSeq
.
realloc
(
2
);
}
// Compute the dashed line primitive
// Compute the dashed line primitive
drawinglayer
::
primitive2d
::
PolyPolygonStrokePrimitive2D
*
pLine
=
drawinglayer
::
primitive2d
::
PolyPolygonStrokePrimitive2D
*
pLine
=
new
drawinglayer
::
primitive2d
::
PolyPolygonStrokePrimitive2D
(
new
drawinglayer
::
primitive2d
::
PolyPolygonStrokePrimitive2D
(
...
@@ -3320,7 +3331,8 @@ drawinglayer::primitive2d::Primitive2DSequence lcl_CreateHeaderFooterSeparatorPr
...
@@ -3320,7 +3331,8 @@ drawinglayer::primitive2d::Primitive2DSequence lcl_CreateHeaderFooterSeparatorPr
drawinglayer
::
attribute
::
LineAttribute
(
aLineColor
),
drawinglayer
::
attribute
::
LineAttribute
(
aLineColor
),
drawinglayer
::
attribute
::
StrokeAttribute
(
aStrokePattern
)
);
drawinglayer
::
attribute
::
StrokeAttribute
(
aStrokePattern
)
);
aSeq
[
1
]
=
drawinglayer
::
primitive2d
::
Primitive2DReference
(
pLine
);
aSeq
[
aSeq
.
getLength
(
)
-
1
]
=
drawinglayer
::
primitive2d
::
Primitive2DReference
(
pLine
);
return
aSeq
;
return
aSeq
;
}
}
...
...
sw/source/ui/docvw/HeaderFooterWin.cxx
Dosyayı görüntüle @
e88eb733
...
@@ -79,11 +79,23 @@ namespace
...
@@ -79,11 +79,23 @@ namespace
void
lcl_DrawBackground
(
OutputDevice
*
pOut
,
const
Rectangle
&
rRect
,
bool
bHeader
)
void
lcl_DrawBackground
(
OutputDevice
*
pOut
,
const
Rectangle
&
rRect
,
bool
bHeader
)
{
{
// Colors
basegfx
::
BColor
aLineColor
=
SwViewOption
::
GetHeaderFooterMarkColor
().
getBColor
();
basegfx
::
BColor
aLineColor
=
SwViewOption
::
GetHeaderFooterMarkColor
().
getBColor
();
const
StyleSettings
&
rSettings
=
Application
::
GetSettings
().
GetStyleSettings
();
if
(
rSettings
.
GetHighContrastMode
()
)
{
aLineColor
=
rSettings
.
GetDialogTextColor
().
getBColor
();
pOut
->
SetFillColor
(
rSettings
.
GetDialogColor
(
)
);
pOut
->
SetLineColor
(
rSettings
.
GetDialogTextColor
(
)
);
pOut
->
DrawRect
(
rRect
);
}
else
{
// Colors
basegfx
::
BColor
aFillColor
=
lcl_GetFillColor
(
aLineColor
);
basegfx
::
BColor
aFillColor
=
lcl_GetFillColor
(
aLineColor
);
basegfx
::
BColor
aLighterColor
=
lcl_GetLighterGradientColor
(
aFillColor
);
basegfx
::
BColor
aLighterColor
=
lcl_GetLighterGradientColor
(
aFillColor
);
// Draw the background gradient
// Draw the background gradient
Gradient
aGradient
;
Gradient
aGradient
;
if
(
bHeader
)
if
(
bHeader
)
...
@@ -97,7 +109,7 @@ namespace
...
@@ -97,7 +109,7 @@ namespace
pOut
->
SetFillColor
(
Color
(
aFillColor
)
);
pOut
->
SetFillColor
(
Color
(
aFillColor
)
);
pOut
->
SetLineColor
(
Color
(
aFillColor
)
);
pOut
->
SetLineColor
(
Color
(
aFillColor
)
);
}
// Draw the lines around the rect
// Draw the lines around the rect
pOut
->
SetLineColor
(
Color
(
aLineColor
)
);
pOut
->
SetLineColor
(
Color
(
aLineColor
)
);
...
@@ -203,7 +215,10 @@ void SwHeaderFooterWin::Paint( const Rectangle& )
...
@@ -203,7 +215,10 @@ void SwHeaderFooterWin::Paint( const Rectangle& )
GetTextBoundRect
(
aTextRect
,
String
(
m_sLabel
)
);
GetTextBoundRect
(
aTextRect
,
String
(
m_sLabel
)
);
Point
aTextPos
=
aTextRect
.
TopLeft
()
+
Point
(
TEXT_PADDING
,
0
);
Point
aTextPos
=
aTextRect
.
TopLeft
()
+
Point
(
TEXT_PADDING
,
0
);
const
StyleSettings
&
rSettings
=
Application
::
GetSettings
().
GetStyleSettings
();
basegfx
::
BColor
aLineColor
=
SwViewOption
::
GetHeaderFooterMarkColor
().
getBColor
();
basegfx
::
BColor
aLineColor
=
SwViewOption
::
GetHeaderFooterMarkColor
().
getBColor
();
if
(
rSettings
.
GetHighContrastMode
(
)
)
aLineColor
=
rSettings
.
GetDialogTextColor
().
getBColor
();
SetTextColor
(
Color
(
aLineColor
)
);
SetTextColor
(
Color
(
aLineColor
)
);
DrawText
(
aTextPos
,
String
(
m_sLabel
)
);
DrawText
(
aTextPos
,
String
(
m_sLabel
)
);
...
...
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