Skip to content

Commit 353a4e1

Browse files
committed
Client: Deprecate Label in Node control.
The Canvas control intercepts all input and will handle input logic of nodes. Removing detection of double click on the Text control.
1 parent ca3ca1e commit 353a4e1

File tree

2 files changed

+2
-48
lines changed

2 files changed

+2
-48
lines changed

Source/Client/Controls/Node.cpp

Lines changed: 1 addition & 33 deletions
Original file line numberDiff line numberDiff line change
@@ -87,11 +87,7 @@ Node::Header::Header(OctaneGUI::Window* Window)
8787
SetGrow(OctaneGUI::Grow::Center);
8888
SetExpand(OctaneGUI::Expand::Width);
8989

90-
m_Label = AddControl<Label>();
91-
m_Label->SetOnEdit([this](OctaneGUI::Control&) -> void
92-
{
93-
Edit();
94-
});
90+
m_Label = AddControl<OctaneGUI::Text>();
9591
Set(U"New Snippet");
9692

9793
m_Input = std::make_shared<OctaneGUI::TextInput>(Window);
@@ -143,33 +139,5 @@ Node::Header& Node::Header::FinishEdit()
143139
return *this;
144140
}
145141

146-
//
147-
// Node::Header::Label
148-
//
149-
150-
Node::Header::Label::Label(OctaneGUI::Window* Window)
151-
: Text(Window)
152-
{
153-
}
154-
155-
Node::Header::Label& Node::Header::Label::SetOnEdit(OctaneGUI::OnControlSignature&& Fn)
156-
{
157-
m_OnEdit = std::move(Fn);
158-
return *this;
159-
}
160-
161-
bool Node::Header::Label::OnMousePressed(const OctaneGUI::Vector2&, OctaneGUI::Mouse::Button Button, OctaneGUI::Mouse::Count Count)
162-
{
163-
if (Button == OctaneGUI::Mouse::Button::Left && Count == OctaneGUI::Mouse::Count::Double)
164-
{
165-
if (m_OnEdit)
166-
{
167-
m_OnEdit(*this);
168-
}
169-
}
170-
171-
return false;
172-
}
173-
174142
}
175143
}

Source/Client/Controls/Node.h

Lines changed: 1 addition & 15 deletions
Original file line numberDiff line numberDiff line change
@@ -27,7 +27,6 @@ SOFTWARE.
2727
#pragma once
2828

2929
#include "OctaneGUI/Controls/HorizontalContainer.h"
30-
#include "OctaneGUI/Controls/Text.h"
3130

3231
namespace OctaneGUI
3332
{
@@ -64,22 +63,9 @@ class Node : public OctaneGUI::Container
6463
virtual void Update() override;
6564

6665
private:
67-
class Label : public OctaneGUI::Text
68-
{
69-
public:
70-
Label(OctaneGUI::Window* Window);
71-
72-
Label& SetOnEdit(OctaneGUI::OnControlSignature&& Fn);
73-
74-
virtual bool OnMousePressed(const OctaneGUI::Vector2& Position, OctaneGUI::Mouse::Button Button, OctaneGUI::Mouse::Count Count) override;
75-
76-
private:
77-
OctaneGUI::OnControlSignature m_OnEdit { nullptr };
78-
};
79-
8066
Header& FinishEdit();
8167

82-
std::shared_ptr<Label> m_Label { nullptr };
68+
std::shared_ptr<OctaneGUI::Text> m_Label { nullptr };
8369
std::shared_ptr<OctaneGUI::TextInput> m_Input { nullptr };
8470
};
8571

0 commit comments

Comments
 (0)