mirror of
https://github.com/AyuGram/AyuGramDesktop.git
synced 2025-06-05 06:33:57 +02:00
Added ability to paint circle buttons of accent colors with custom size.
This commit is contained in:
parent
a7e2de53f5
commit
5150ca054e
2 changed files with 11 additions and 3 deletions
|
@ -210,6 +210,7 @@ void ColorsPalette::Button::paint() {
|
||||||
if (_colors.size() == 1) {
|
if (_colors.size() == 1) {
|
||||||
PaintRoundColorButton(
|
PaintRoundColorButton(
|
||||||
p,
|
p,
|
||||||
|
st::settingsAccentColorSize,
|
||||||
_colors.front(),
|
_colors.front(),
|
||||||
_selectedAnimation.value(_selected ? 1. : 0.));
|
_selectedAnimation.value(_selected ? 1. : 0.));
|
||||||
} else if (_colors.size() >= kCustomColorButtonParts) {
|
} else if (_colors.size() >= kCustomColorButtonParts) {
|
||||||
|
@ -371,8 +372,11 @@ void ColorsPalette::updateInnerGeometry() {
|
||||||
|
|
||||||
} // namespace
|
} // namespace
|
||||||
|
|
||||||
void PaintRoundColorButton(QPainter &p, QBrush brush, float64 selected) {
|
void PaintRoundColorButton(
|
||||||
const auto size = st::settingsAccentColorSize;
|
QPainter &p,
|
||||||
|
int size,
|
||||||
|
QBrush brush,
|
||||||
|
float64 selected) {
|
||||||
const auto rect = QRect(0, 0, size, size);
|
const auto rect = QRect(0, 0, size, size);
|
||||||
|
|
||||||
p.setBrush(brush);
|
p.setBrush(brush);
|
||||||
|
|
|
@ -31,7 +31,11 @@ void SetupExport(
|
||||||
not_null<Window::SessionController*> controller,
|
not_null<Window::SessionController*> controller,
|
||||||
not_null<Ui::VerticalLayout*> container);
|
not_null<Ui::VerticalLayout*> container);
|
||||||
|
|
||||||
void PaintRoundColorButton(QPainter &p, QBrush brush, float64 selected);
|
void PaintRoundColorButton(
|
||||||
|
QPainter &p,
|
||||||
|
int size,
|
||||||
|
QBrush brush,
|
||||||
|
float64 selected);
|
||||||
|
|
||||||
class Chat : public Section<Chat> {
|
class Chat : public Section<Chat> {
|
||||||
public:
|
public:
|
||||||
|
|
Loading…
Add table
Reference in a new issue