mirror of
https://github.com/RGBCube/serenity
synced 2025-05-31 09:38:11 +00:00
LibGfx+LibGUI: Allow setting tab text alignment with set_property()
This commit is contained in:
parent
856f683dc9
commit
e78cf6c590
2 changed files with 28 additions and 0 deletions
|
@ -24,6 +24,7 @@
|
|||
* OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
|
||||
*/
|
||||
|
||||
#include <AK/JsonObject.h>
|
||||
#include <AK/JsonValue.h>
|
||||
#include <LibGUI/BoxLayout.h>
|
||||
#include <LibGUI/Painter.h>
|
||||
|
@ -407,6 +408,13 @@ bool TabWidget::set_property(const StringView& name, const JsonValue& value)
|
|||
return true;
|
||||
}
|
||||
|
||||
if (name == "text_alignment") {
|
||||
auto alignment = Gfx::text_alignment_from_string(value.to_string());
|
||||
if (alignment.has_value())
|
||||
set_text_alignment(alignment.value());
|
||||
return true;
|
||||
}
|
||||
|
||||
return Widget::set_property(name, value);
|
||||
}
|
||||
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue