mirror of
https://github.com/RGBCube/serenity
synced 2025-05-28 11:15:10 +00:00
Move VisualBuilder into a new DevTools directory.
This commit is contained in:
parent
6b40b081b2
commit
3ae9fc5d88
18 changed files with 3 additions and 3 deletions
33
DevTools/VisualBuilder/VBProperty.cpp
Normal file
33
DevTools/VisualBuilder/VBProperty.cpp
Normal file
|
@ -0,0 +1,33 @@
|
|||
#include "VBProperty.h"
|
||||
#include "VBWidget.h"
|
||||
|
||||
VBProperty::VBProperty(VBWidget& widget, const String& name, const GVariant& value)
|
||||
: m_widget(widget)
|
||||
, m_name(name)
|
||||
, m_value(value)
|
||||
{
|
||||
}
|
||||
|
||||
VBProperty::VBProperty(VBWidget& widget, const String& name, Function<GVariant(const GWidget&)>&& getter, Function<void(GWidget&, const GVariant&)>&& setter)
|
||||
: m_widget(widget)
|
||||
, m_name(name)
|
||||
, m_getter(move(getter))
|
||||
, m_setter(move(setter))
|
||||
{
|
||||
ASSERT(m_getter);
|
||||
ASSERT(m_setter);
|
||||
}
|
||||
|
||||
VBProperty::~VBProperty()
|
||||
{
|
||||
}
|
||||
|
||||
void VBProperty::set_value(const GVariant& value)
|
||||
{
|
||||
if (m_value == value)
|
||||
return;
|
||||
m_value = value;
|
||||
if (m_setter)
|
||||
m_setter(*m_widget.gwidget(), value);
|
||||
m_widget.property_did_change();
|
||||
}
|
Loading…
Add table
Add a link
Reference in a new issue