mirror of
https://github.com/AyuGram/AyuGramDesktop.git
synced 2025-04-19 07:37:11 +02:00
Added ability to change initial color in color editor.
This commit is contained in:
parent
27ff6b3446
commit
6bac662ee8
3 changed files with 14 additions and 4 deletions
|
@ -274,7 +274,9 @@ object_ptr<Ui::RpWidget> CreateGradientEditor(
|
|||
buttonsContainer->chosenChanges(
|
||||
) | rpl::start_with_next([=](ColorsLine::Chosen *chosen) {
|
||||
if (chosen) {
|
||||
editor->showColor(state->colors[chosen->index()]);
|
||||
const auto color = state->colors[chosen->index()];
|
||||
editor->showColor(color);
|
||||
editor->setCurrent(color);
|
||||
}
|
||||
}, editor->lifetime());
|
||||
|
||||
|
|
|
@ -1270,3 +1270,12 @@ void ColorEditor::setRGB(int red, int green, int blue, int alpha) {
|
|||
updateHSBFields();
|
||||
update();
|
||||
}
|
||||
|
||||
void ColorEditor::showColor(QColor color) {
|
||||
updateFromColor(color);
|
||||
}
|
||||
|
||||
void ColorEditor::setCurrent(QColor color) {
|
||||
_current = color;
|
||||
update();
|
||||
}
|
||||
|
|
|
@ -27,9 +27,8 @@ public:
|
|||
[[nodiscard]] rpl::producer<QColor> colorValue() const;
|
||||
[[nodiscard]] rpl::producer<> submitRequests() const;
|
||||
|
||||
void showColor(QColor color) {
|
||||
updateFromColor(color);
|
||||
}
|
||||
void showColor(QColor color);
|
||||
void setCurrent(QColor color);
|
||||
|
||||
void setInnerFocus() const;
|
||||
|
||||
|
|
Loading…
Add table
Reference in a new issue