2
0
mirror of https://github.com/kotatogram/kotatogram-desktop synced 2025-08-31 22:55:11 +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

@@ -48,12 +48,6 @@ int peerColorIndex(const PeerId &peer) {
return (md5[peerId & 0x0F] & (peerIsUser(peer) ? 0x07 : 0x03));
}
struct ColorReferenceWrap {
ColorReferenceWrap(const style::color &data) : data(data) {
}
const style::color &data;
};
ImagePtr generateUserpicImage(const style::icon &icon) {
auto data = QImage(icon.size() * cIntRetinaFactor(), QImage::Format_ARGB32_Premultiplied);
data.setDevicePixelRatio(cRetinaFactor());
@@ -67,17 +61,17 @@ ImagePtr generateUserpicImage(const style::icon &icon) {
} // namespace
const style::color &peerColor(int index) {
static const ColorReferenceWrap peerColors[kUserColorsCount] = {
st::historyPeer1NameFg,
st::historyPeer2NameFg,
st::historyPeer3NameFg,
st::historyPeer4NameFg,
st::historyPeer5NameFg,
st::historyPeer6NameFg,
st::historyPeer7NameFg,
st::historyPeer8NameFg,
static const style::color *peerColors[kUserColorsCount] = {
&st::historyPeer1NameFg,
&st::historyPeer2NameFg,
&st::historyPeer3NameFg,
&st::historyPeer4NameFg,
&st::historyPeer5NameFg,
&st::historyPeer6NameFg,
&st::historyPeer7NameFg,
&st::historyPeer8NameFg,
};
return peerColors[index].data;
return *peerColors[index];
}
ImagePtr userDefPhoto(int index) {