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
4d1f2de8
Kaydet (Commit)
4d1f2de8
authored
Ara 27, 2014
tarafından
Tomaž Vajngerl
Dosyalara gözat
Seçenekler
Dosyalara Gözat
İndir
Eposta Yamaları
Sade Fark
Cleanup and simplify TabDrawer & remove maPoly
Change-Id: Ib11a610bafcc54516b873304f778ee92603d5c31
üst
e4de5b40
Hide whitespace changes
Inline
Side-by-side
Showing
1 changed file
with
47 additions
and
67 deletions
+47
-67
tabbar.cxx
svtools/source/control/tabbar.cxx
+47
-67
No files found.
svtools/source/control/tabbar.cxx
Dosyayı görüntüle @
4d1f2de8
...
...
@@ -1066,9 +1066,6 @@ void TabBar::MouseButtonUp( const MouseEvent& rMEvt )
Window
::
MouseButtonUp
(
rMEvt
);
}
namespace
{
class
TabBarPaintGuard
...
...
@@ -1101,7 +1098,6 @@ public:
explicit
TabDrawer
(
TabBar
&
rParent
)
:
mrParent
(
rParent
),
mpStyleSettings
(
&
mrParent
.
GetSettings
().
GetStyleSettings
()),
maPoly
(
4
),
mbSelected
(
false
),
mbCustomColored
(
false
),
mbSpecialTab
(
false
),
...
...
@@ -1114,27 +1110,44 @@ public:
WinBits
nWinStyle
=
mrParent
.
GetStyle
();
// draw extra line if above and below border
if
(
(
nWinStyle
&
WB_BORDER
)
||
(
nWinStyle
&
WB_TOPBORDER
)
)
if
(
(
nWinStyle
&
WB_BORDER
)
||
(
nWinStyle
&
WB_TOPBORDER
)
)
{
Size
aOutputSize
=
mrParent
.
GetOutputSizePixel
();
Rectangle
aOutRect
=
mrParent
.
GetPageArea
();
// also draw border in 3D for 3D-tabs
if
(
nWinStyle
&
WB_3DTAB
)
if
(
nWinStyle
&
WB_3DTAB
)
{
mrParent
.
SetLineColor
(
mpStyleSettings
->
GetShadowColor
()
);
mrParent
.
DrawLine
(
Point
(
aOutRect
.
Left
(),
0
),
Point
(
aOutputSize
.
Width
(),
0
)
);
mrParent
.
SetLineColor
(
mpStyleSettings
->
GetShadowColor
()
);
mrParent
.
DrawLine
(
Point
(
aOutRect
.
Left
(),
0
),
Point
(
aOutputSize
.
Width
(),
0
)
);
}
// draw border (line above and line below)
mrParent
.
SetLineColor
(
mpStyleSettings
->
GetDarkShadowColor
()
);
mrParent
.
DrawLine
(
aOutRect
.
TopLeft
(),
Point
(
aOutputSize
.
Width
()
-
1
,
aOutRect
.
Top
()
)
);
mrParent
.
SetLineColor
(
mpStyleSettings
->
GetDarkShadowColor
()
);
mrParent
.
DrawLine
(
aOutRect
.
TopLeft
(),
Point
(
aOutputSize
.
Width
()
-
1
,
aOutRect
.
Top
())
);
}
}
void
drawOuterFrame
()
{
mrParent
.
DrawPolygon
(
maPoly
);
mrParent
.
SetLineColor
(
mpStyleSettings
->
GetDarkShadowColor
());
// set correct FillInBrush depending on status
if
(
mbSelected
)
{
// Currently selected Tab
mrParent
.
SetFillColor
(
maSelectedColor
);
}
else
if
(
mbCustomColored
)
{
mrParent
.
SetFillColor
(
maCustomColor
);
}
else
{
mrParent
.
SetFillColor
(
maUnselectedColor
);
}
mrParent
.
DrawRect
(
maRect
);
}
void
drawText
(
const
OUString
&
aText
)
...
...
@@ -1149,60 +1162,36 @@ public:
if
(
mbEnabled
)
mrParent
.
DrawText
(
aPos
,
aText
);
else
mrParent
.
DrawCtrlText
(
aPos
,
aText
,
0
,
aText
.
getLength
(),
(
TEXT_DRAW_DISABLE
|
TEXT_DRAW_MNEMONIC
));
mrParent
.
DrawCtrlText
(
aPos
,
aText
,
0
,
aText
.
getLength
(),
(
TEXT_DRAW_DISABLE
|
TEXT_DRAW_MNEMONIC
));
}
void
drawOverTopBorder
(
bool
b3DTab
)
void
drawOverTopBorder
()
{
Point
p1
=
maPoly
[
0
];
Point
p2
=
maPoly
[
3
];
p1
.
X
()
+=
1
;
p2
.
X
()
-=
1
;
Rectangle
aDelRect
(
p1
,
p2
);
Point
aTopLeft
=
maRect
.
TopLeft
()
+
Point
(
1
,
0
);
Point
aTopRight
=
maRect
.
TopRight
()
+
Point
(
-
1
,
0
);
Rectangle
aDelRect
(
aTopLeft
,
aTopRight
);
mrParent
.
DrawRect
(
aDelRect
);
if
(
b3DTab
)
{
aDelRect
.
Top
()
--
;
mrParent
.
DrawRect
(
aDelRect
);
}
}
void
drawColorLine
()
{
Point
p1
=
maPoly
[
1
];
Point
p2
=
maPoly
[
2
];
p1
+=
Point
(
1
,
0
);
p2
+=
Point
(
-
1
,
-
3
);
mrParent
.
SetFillColor
(
maCustomColor
);
mrParent
.
SetLineColor
(
maCustomColor
);
mrParent
.
DrawRect
(
Rectangle
(
p1
,
p2
));
Rectangle
aLineRect
(
maRect
.
BottomLeft
(),
maRect
.
BottomRight
());
aLineRect
.
Top
()
-=
3
;
mrParent
.
DrawRect
(
aLineRect
);
}
void
drawTab
()
{
mrParent
.
SetLineColor
(
mpStyleSettings
->
GetDarkShadowColor
());
// set correct FillInBrush depending on status
if
(
mbSelected
)
{
// Currently selected Tab
mrParent
.
SetFillColor
(
maSelectedColor
);
}
else
if
(
mbCustomColored
)
{
mrParent
.
SetFillColor
(
maCustomColor
);
}
else
{
mrParent
.
SetFillColor
(
maUnselectedColor
);
}
drawOuterFrame
();
if
(
mbCustomColored
&&
mbSelected
)
{
mrParent
.
SetFillColor
(
maCustomColor
);
mrParent
.
SetLineColor
(
maCustomColor
);
drawColorLine
();
}
}
...
...
@@ -1233,34 +1222,26 @@ public:
void
setRect
(
const
Rectangle
&
rRect
)
{
maRect
=
rRect
;
long
nOffY
=
mrParent
.
GetPageArea
().
getY
();
// first draw filled polygon
maPoly
[
0
]
=
Point
(
rRect
.
Left
(),
nOffY
);
maPoly
[
1
]
=
Point
(
rRect
.
Left
(),
rRect
.
Bottom
()
);
maPoly
[
2
]
=
Point
(
rRect
.
Right
(),
rRect
.
Bottom
()
);
maPoly
[
3
]
=
Point
(
rRect
.
Right
(),
nOffY
);
}
void
setSelected
(
bool
b
)
void
setSelected
(
bool
b
Selected
)
{
mbSelected
=
b
;
mbSelected
=
b
Selected
;
}
void
setCustomColored
(
bool
b
)
void
setCustomColored
(
bool
b
CustomColored
)
{
mbCustomColored
=
b
;
mbCustomColored
=
b
CustomColored
;
}
void
setSpecialTab
(
bool
b
)
void
setSpecialTab
(
bool
b
SpecialTab
)
{
mbSpecialTab
=
b
;
mbSpecialTab
=
b
SpecialTab
;
}
void
setEnabled
(
bool
b
)
void
setEnabled
(
bool
b
Enabled
)
{
mbEnabled
=
b
;
mbEnabled
=
b
Enabled
;
}
void
setSelectedFillColor
(
const
Color
&
rColor
)
...
...
@@ -1283,7 +1264,6 @@ private:
const
StyleSettings
*
mpStyleSettings
;
Rectangle
maRect
;
Polygon
maPoly
;
Color
maSelectedColor
;
Color
maCustomColor
;
...
...
@@ -1295,7 +1275,7 @@ private:
bool
mbEnabled
:
1
;
};
}
}
// anonymous namespace
void
TabBar
::
Paint
(
const
Rectangle
&
rect
)
{
...
...
@@ -1399,7 +1379,7 @@ void TabBar::Paint( const Rectangle& rect )
{
SetLineColor
();
SetFillColor
(
aSelectColor
);
aDrawer
.
drawOverTopBorder
(
mnWinStyle
&
WB_3DTAB
);
aDrawer
.
drawOverTopBorder
();
return
;
}
...
...
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