2
0
mirror of https://github.com/telegramdesktop/tdesktop synced 2025-08-31 22:46:10 +00:00

Closed beta 10019001: style::color copy is denied, only const refs.

This commit is contained in:
John Preston
2016-11-03 13:33:57 +03:00
parent 5d10c02b5b
commit 2a3fd0066d
44 changed files with 344 additions and 381 deletions

View File

@@ -210,24 +210,44 @@ int32 documentColorIndex(DocumentData *document, QString &ext) {
return colorIndex;
}
style::color documentColor(int32 colorIndex) {
static style::color colors[] = { st::msgFileBlueColor, st::msgFileGreenColor, st::msgFileRedColor, st::msgFileYellowColor };
return colors[colorIndex & 3];
const style::color &documentColor(int32 colorIndex) {
static const style::color *colors[] = {
&st::msgFileBlueColor,
&st::msgFileGreenColor,
&st::msgFileRedColor,
&st::msgFileYellowColor
};
return *colors[colorIndex & 3];
}
style::color documentDarkColor(int32 colorIndex) {
static style::color colors[] = { st::msgFileBlueDark, st::msgFileGreenDark, st::msgFileRedDark, st::msgFileYellowDark };
return colors[colorIndex & 3];
const style::color &documentDarkColor(int32 colorIndex) {
static const style::color *colors[] = {
&st::msgFileBlueDark,
&st::msgFileGreenDark,
&st::msgFileRedDark,
&st::msgFileYellowDark
};
return *colors[colorIndex & 3];
}
style::color documentOverColor(int32 colorIndex) {
static style::color colors[] = { st::msgFileBlueOver, st::msgFileGreenOver, st::msgFileRedOver, st::msgFileYellowOver };
return colors[colorIndex & 3];
const style::color &documentOverColor(int32 colorIndex) {
static const style::color *colors[] = {
&st::msgFileBlueOver,
&st::msgFileGreenOver,
&st::msgFileRedOver,
&st::msgFileYellowOver
};
return *colors[colorIndex & 3];
}
style::color documentSelectedColor(int32 colorIndex) {
static style::color colors[] = { st::msgFileBlueSelected, st::msgFileGreenSelected, st::msgFileRedSelected, st::msgFileYellowSelected };
return colors[colorIndex & 3];
const style::color &documentSelectedColor(int32 colorIndex) {
static const style::color *colors[] = {
&st::msgFileBlueSelected,
&st::msgFileGreenSelected,
&st::msgFileRedSelected,
&st::msgFileYellowSelected
};
return *colors[colorIndex & 3];
}
RoundCorners documentCorners(int32 colorIndex) {