mirror of
https://github.com/AyuGram/AyuGramDesktop.git
synced 2025-04-18 07:07:08 +02:00
Added dummy buttons to PhotoEditorControls.
This commit is contained in:
parent
d8921c7cf5
commit
99deaf6005
5 changed files with 60 additions and 2 deletions
Telegram
SourceFiles/editor
cmake
23
Telegram/SourceFiles/editor/editor.style
Normal file
23
Telegram/SourceFiles/editor/editor.style
Normal file
|
@ -0,0 +1,23 @@
|
|||
/*
|
||||
This file is part of Telegram Desktop,
|
||||
the official desktop application for the Telegram messaging service.
|
||||
|
||||
For license and copyright information please follow this link:
|
||||
https://github.com/telegramdesktop/tdesktop/blob/master/LEGAL
|
||||
*/
|
||||
using "ui/basic.style";
|
||||
|
||||
using "boxes/boxes.style";
|
||||
using "ui/widgets/widgets.style";
|
||||
using "ui/chat/chat.style";
|
||||
|
||||
photoEditorControlsHeight: 100px;
|
||||
|
||||
photoEditorRotateButton: IconButton(historyAttach) {
|
||||
icon: icon {{ "send_control_attach", historyComposeIconFg }};
|
||||
iconOver: icon {{ "send_control_attach", historyComposeIconFgOver }};
|
||||
}
|
||||
photoEditorFlipButton: IconButton(historyAttach) {
|
||||
icon: icon {{ "send_control_attach", historyComposeIconFg }};
|
||||
iconOver: icon {{ "send_control_attach", historyComposeIconFgOver }};
|
||||
}
|
|
@ -9,6 +9,7 @@ https://github.com/telegramdesktop/tdesktop/blob/master/LEGAL
|
|||
|
||||
#include "editor/photo_editor_content.h"
|
||||
#include "editor/photo_editor_controls.h"
|
||||
#include "styles/style_editor.h"
|
||||
|
||||
namespace Editor {
|
||||
|
||||
|
@ -20,7 +21,13 @@ PhotoEditor::PhotoEditor(
|
|||
, _controls(base::make_unique_q<PhotoEditorControls>(this)) {
|
||||
sizeValue(
|
||||
) | rpl::start_with_next([=](const QSize &size) {
|
||||
_content->resize(size);
|
||||
const auto geometry = QRect(QPoint(), size);
|
||||
const auto contentRect = geometry
|
||||
- style::margins(0, 0, 0, st::photoEditorControlsHeight);
|
||||
_content->setGeometry(contentRect);
|
||||
const auto controlsRect = geometry
|
||||
- style::margins(0, contentRect.height(), 0, 0);
|
||||
_controls->setGeometry(controlsRect);
|
||||
}, lifetime());
|
||||
}
|
||||
|
||||
|
|
|
@ -8,6 +8,9 @@ https://github.com/telegramdesktop/tdesktop/blob/master/LEGAL
|
|||
#include "editor/photo_editor_controls.h"
|
||||
|
||||
#include "ui/cached_round_corners.h"
|
||||
#include "ui/widgets/buttons.h"
|
||||
#include "styles/style_editor.h"
|
||||
|
||||
namespace Editor {
|
||||
|
||||
class HorizontalContainer final : public Ui::RpWidget {
|
||||
|
@ -40,10 +43,28 @@ PhotoEditorControls::PhotoEditorControls(
|
|||
not_null<Ui::RpWidget*> parent,
|
||||
bool doneControls)
|
||||
: RpWidget(parent)
|
||||
, _buttonsContainer(base::make_unique_q<HorizontalContainer>(this)) {
|
||||
, _buttonsContainer(base::make_unique_q<HorizontalContainer>(this))
|
||||
, _rotateButton(base::make_unique_q<Ui::IconButton>(
|
||||
_buttonsContainer,
|
||||
st::photoEditorRotateButton))
|
||||
, _flipButton(base::make_unique_q<Ui::IconButton>(
|
||||
_buttonsContainer,
|
||||
st::photoEditorFlipButton)) {
|
||||
|
||||
_buttonsContainer->updateChildrenPosition();
|
||||
|
||||
paintRequest(
|
||||
) | rpl::start_with_next([=](const QRect &clip) {
|
||||
Painter p(this);
|
||||
|
||||
Ui::FillRoundRect(
|
||||
p,
|
||||
_buttonsContainer->geometry(),
|
||||
st::mediaviewSaveMsgBg,
|
||||
Ui::MediaviewSaveCorners);
|
||||
|
||||
}, lifetime());
|
||||
|
||||
sizeValue(
|
||||
) | rpl::start_with_next([=](const QSize &size) {
|
||||
|
||||
|
|
|
@ -9,6 +9,10 @@ https://github.com/telegramdesktop/tdesktop/blob/master/LEGAL
|
|||
|
||||
#include "ui/rp_widget.h"
|
||||
|
||||
namespace Ui {
|
||||
class IconButton;
|
||||
} // namespace Ui
|
||||
|
||||
namespace Editor {
|
||||
|
||||
class HorizontalContainer;
|
||||
|
@ -22,6 +26,8 @@ public:
|
|||
private:
|
||||
|
||||
const base::unique_qptr<HorizontalContainer> _buttonsContainer;
|
||||
const base::unique_qptr<Ui::IconButton> _rotateButton;
|
||||
const base::unique_qptr<Ui::IconButton> _flipButton;
|
||||
|
||||
};
|
||||
|
||||
|
|
|
@ -30,6 +30,7 @@ set(style_files
|
|||
media/view/media_view.style
|
||||
overview/overview.style
|
||||
window/window.style
|
||||
editor/editor.style
|
||||
)
|
||||
|
||||
set(dependent_style_files
|
||||
|
|
Loading…
Add table
Reference in a new issue