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
6581d0b3
Kaydet (Commit)
6581d0b3
authored
Nis 22, 2015
tarafından
Tomaž Vajngerl
Dosyalara gözat
Seçenekler
Dosyalara Gözat
İndir
Eposta Yamaları
Sade Fark
Modify tint/shade for theme colors, different shades for headings
Change-Id: I6e6fbcb64f14c1abe07902c4dd53ef154aae29f7
üst
5d23d11c
Hide whitespace changes
Inline
Side-by-side
Showing
1 changed file
with
91 additions
and
7 deletions
+91
-7
ThemePanel.cxx
sw/source/uibase/sidebar/ThemePanel.cxx
+91
-7
No files found.
sw/source/uibase/sidebar/ThemePanel.cxx
Dosyayı görüntüle @
6581d0b3
...
...
@@ -15,6 +15,8 @@
#include <swtypes.hxx>
#include <cmdid.h>
#include <tools/helpers.hxx>
#include <svl/intitem.hxx>
#include <svx/svxids.hrc>
#include <svx/dlgutil.hxx>
...
...
@@ -65,15 +67,19 @@ class ColorVariable
public
:
long
mnIndex
;
Color
maColor
;
sal_Int16
mnTintShade
;
ColorVariable
()
:
mnIndex
(
-
1
)
,
maColor
()
,
mnTintShade
()
{}
ColorVariable
(
long
nIndex
)
ColorVariable
(
long
nIndex
,
sal_Int16
nTintShade
=
0
)
:
mnIndex
(
nIndex
)
,
maColor
()
,
mnTintShade
(
nTintShade
)
{}
};
class
StyleRedefinition
...
...
@@ -95,14 +101,30 @@ public:
Color
getColor
(
ColorSet
&
rColorSet
)
{
Color
aColor
;
if
(
maVariable
.
mnIndex
>
-
1
)
{
return
rColorSet
.
maColors
[
maVariable
.
mnIndex
];
aColor
.
SetColor
(
rColorSet
.
maColors
[
maVariable
.
mnIndex
].
GetColor
());
if
(
maVariable
.
mnTintShade
<
0
)
{
double
fFactor
=
std
::
abs
(
maVariable
.
mnTintShade
)
/
10000.0
;
aColor
.
SetRed
(
MinMax
(
aColor
.
GetRed
()
+
(
fFactor
*
(
255.0
-
aColor
.
GetRed
())),
0
,
255
));
aColor
.
SetGreen
(
MinMax
(
aColor
.
GetGreen
()
+
(
fFactor
*
(
255.0
-
aColor
.
GetGreen
())),
0
,
255
));
aColor
.
SetBlue
(
MinMax
(
aColor
.
GetBlue
()
+
(
fFactor
*
(
255.0
-
aColor
.
GetBlue
())),
0
,
255
));
}
else
if
(
maVariable
.
mnTintShade
>
0
)
{
double
fFactor
=
1.0
-
std
::
abs
(
maVariable
.
mnTintShade
)
/
10000.0
;
aColor
.
SetRed
(
MinMax
(
aColor
.
GetRed
()
*
fFactor
,
0
,
255
));
aColor
.
SetGreen
(
MinMax
(
aColor
.
GetGreen
()
*
fFactor
,
0
,
255
));
aColor
.
SetBlue
(
MinMax
(
aColor
.
GetBlue
()
*
fFactor
,
0
,
255
));
}
}
else
{
return
maVariable
.
maColor
;
aColor
.
SetColor
(
maVariable
.
maColor
.
GetColor
())
;
}
return
aColor
;
}
};
...
...
@@ -139,9 +161,65 @@ StyleSet setupThemes()
{
StyleSet
aSet
(
"Default"
);
StyleRedefinition
aRedefinition
(
"Heading"
);
aRedefinition
.
setColorVariable
(
ColorVariable
(
0
));
aSet
.
add
(
aRedefinition
);
{
StyleRedefinition
aRedefinition
(
"Heading 1"
);
aRedefinition
.
setColorVariable
(
ColorVariable
(
0
,
4000
));
aSet
.
add
(
aRedefinition
);
}
{
StyleRedefinition
aRedefinition
(
"Heading 2"
);
aRedefinition
.
setColorVariable
(
ColorVariable
(
0
,
2500
));
aSet
.
add
(
aRedefinition
);
}
{
StyleRedefinition
aRedefinition
(
"Heading 3"
);
aRedefinition
.
setColorVariable
(
ColorVariable
(
0
,
1000
));
aSet
.
add
(
aRedefinition
);
}
{
StyleRedefinition
aRedefinition
(
"Heading 4"
);
aRedefinition
.
setColorVariable
(
ColorVariable
(
0
));
aSet
.
add
(
aRedefinition
);
}
{
StyleRedefinition
aRedefinition
(
"Heading 5"
);
aRedefinition
.
setColorVariable
(
ColorVariable
(
0
,
-
500
));
aSet
.
add
(
aRedefinition
);
}
{
StyleRedefinition
aRedefinition
(
"Heading 6"
);
aRedefinition
.
setColorVariable
(
ColorVariable
(
0
,
-
1000
));
aSet
.
add
(
aRedefinition
);
}
{
StyleRedefinition
aRedefinition
(
"Heading 7"
);
aRedefinition
.
setColorVariable
(
ColorVariable
(
0
,
-
1500
));
aSet
.
add
(
aRedefinition
);
}
{
StyleRedefinition
aRedefinition
(
"Heading 8"
);
aRedefinition
.
setColorVariable
(
ColorVariable
(
0
,
-
2000
));
aSet
.
add
(
aRedefinition
);
}
{
StyleRedefinition
aRedefinition
(
"Heading 9"
);
aRedefinition
.
setColorVariable
(
ColorVariable
(
0
,
-
2500
));
aSet
.
add
(
aRedefinition
);
}
{
StyleRedefinition
aRedefinition
(
"Heading 10"
);
aRedefinition
.
setColorVariable
(
ColorVariable
(
0
,
-
3000
));
aSet
.
add
(
aRedefinition
);
}
return
aSet
;
}
...
...
@@ -298,6 +376,12 @@ std::vector<ColorSet> initColorSets()
aColorSet
.
maColors
[
0
]
=
Color
(
0x00
,
0x00
,
0xa4
);
aColorSets
.
push_back
(
aColorSet
);
}
{
ColorSet
aColorSet
;
aColorSet
.
maName
=
"Sky"
;
aColorSet
.
maColors
[
0
]
=
Color
(
0x72
,
0x9f
,
0xcf
);
aColorSets
.
push_back
(
aColorSet
);
}
return
aColorSets
;
}
...
...
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