mirror of
https://github.com/LadybirdBrowser/ladybird.git
synced 2025-05-04 10:18:51 +00:00
VisualBuilder: Run clang-format on everything.
This commit is contained in:
parent
fba2c971e7
commit
892acfb10d
Notes:
sideshowbarker
2024-07-19 13:41:29 +09:00
Author: https://github.com/awesomekling
Commit: 892acfb10d
6 changed files with 100 additions and 82 deletions
|
@ -1,11 +1,11 @@
|
||||||
#include "VBForm.h"
|
#include "VBForm.h"
|
||||||
#include "VBWidget.h"
|
|
||||||
#include "VBProperty.h"
|
#include "VBProperty.h"
|
||||||
#include <LibGUI/GPainter.h>
|
#include "VBWidget.h"
|
||||||
#include <LibGUI/GMenu.h>
|
|
||||||
#include <LibGUI/GAction.h>
|
|
||||||
#include <LibGUI/GMessageBox.h>
|
|
||||||
#include <LibCore/CFile.h>
|
#include <LibCore/CFile.h>
|
||||||
|
#include <LibGUI/GAction.h>
|
||||||
|
#include <LibGUI/GMenu.h>
|
||||||
|
#include <LibGUI/GMessageBox.h>
|
||||||
|
#include <LibGUI/GPainter.h>
|
||||||
|
|
||||||
static VBForm* s_current;
|
static VBForm* s_current;
|
||||||
VBForm* VBForm::current()
|
VBForm* VBForm::current()
|
||||||
|
|
|
@ -1,8 +1,8 @@
|
||||||
#include "VBPropertiesWindow.h"
|
#include "VBPropertiesWindow.h"
|
||||||
#include <LibGUI/GWidget.h>
|
|
||||||
#include <LibGUI/GBoxLayout.h>
|
#include <LibGUI/GBoxLayout.h>
|
||||||
#include <LibGUI/GTableView.h>
|
#include <LibGUI/GTableView.h>
|
||||||
#include <LibGUI/GTextBox.h>
|
#include <LibGUI/GTextBox.h>
|
||||||
|
#include <LibGUI/GWidget.h>
|
||||||
|
|
||||||
VBPropertiesWindow::VBPropertiesWindow()
|
VBPropertiesWindow::VBPropertiesWindow()
|
||||||
{
|
{
|
||||||
|
|
|
@ -1,6 +1,6 @@
|
||||||
|
#include "VBWidget.h"
|
||||||
#include "VBForm.h"
|
#include "VBForm.h"
|
||||||
#include "VBProperty.h"
|
#include "VBProperty.h"
|
||||||
#include "VBWidget.h"
|
|
||||||
#include "VBWidgetPropertyModel.h"
|
#include "VBWidgetPropertyModel.h"
|
||||||
#include "VBWidgetRegistry.h"
|
#include "VBWidgetRegistry.h"
|
||||||
#include <LibGUI/GButton.h>
|
#include <LibGUI/GButton.h>
|
||||||
|
@ -103,8 +103,7 @@ void VBWidget::add_property(const String& name, Function<GVariant(const GWidget&
|
||||||
#define VB_ADD_PROPERTY(gclass, name, getter, setter, variant_type) \
|
#define VB_ADD_PROPERTY(gclass, name, getter, setter, variant_type) \
|
||||||
add_property(name, \
|
add_property(name, \
|
||||||
[](auto& widget) -> GVariant { return ((const gclass&)widget).getter(); }, \
|
[](auto& widget) -> GVariant { return ((const gclass&)widget).getter(); }, \
|
||||||
[] (auto& widget, auto& value) { ((gclass&)widget).setter(value.to_ ## variant_type()); } \
|
[](auto& widget, auto& value) { ((gclass&)widget).setter(value.to_##variant_type()); })
|
||||||
)
|
|
||||||
|
|
||||||
void VBWidget::setup_properties()
|
void VBWidget::setup_properties()
|
||||||
{
|
{
|
||||||
|
|
|
@ -1,6 +1,6 @@
|
||||||
#include "VBWidgetPropertyModel.h"
|
#include "VBWidgetPropertyModel.h"
|
||||||
#include "VBWidget.h"
|
|
||||||
#include "VBProperty.h"
|
#include "VBProperty.h"
|
||||||
|
#include "VBWidget.h"
|
||||||
#include <SharedGraphics/Font.h>
|
#include <SharedGraphics/Font.h>
|
||||||
|
|
||||||
VBWidgetPropertyModel::VBWidgetPropertyModel(VBWidget& widget)
|
VBWidgetPropertyModel::VBWidgetPropertyModel(VBWidget& widget)
|
||||||
|
@ -20,9 +20,12 @@ int VBWidgetPropertyModel::row_count(const GModelIndex&) const
|
||||||
String VBWidgetPropertyModel::column_name(int column) const
|
String VBWidgetPropertyModel::column_name(int column) const
|
||||||
{
|
{
|
||||||
switch (column) {
|
switch (column) {
|
||||||
case Column::Name: return "Name";
|
case Column::Name:
|
||||||
case Column::Value: return "Value";
|
return "Name";
|
||||||
default: ASSERT_NOT_REACHED();
|
case Column::Value:
|
||||||
|
return "Value";
|
||||||
|
default:
|
||||||
|
ASSERT_NOT_REACHED();
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
|
@ -39,16 +42,20 @@ GVariant VBWidgetPropertyModel::data(const GModelIndex& index, Role role) const
|
||||||
if (role == Role::Display) {
|
if (role == Role::Display) {
|
||||||
auto& property = *m_widget.m_properties[index.row()];
|
auto& property = *m_widget.m_properties[index.row()];
|
||||||
switch (index.column()) {
|
switch (index.column()) {
|
||||||
case Column::Name: return property.name();
|
case Column::Name:
|
||||||
case Column::Value: return property.value();
|
return property.name();
|
||||||
|
case Column::Value:
|
||||||
|
return property.value();
|
||||||
}
|
}
|
||||||
ASSERT_NOT_REACHED();
|
ASSERT_NOT_REACHED();
|
||||||
}
|
}
|
||||||
if (role == Role::ForegroundColor) {
|
if (role == Role::ForegroundColor) {
|
||||||
auto& property = *m_widget.m_properties[index.row()];
|
auto& property = *m_widget.m_properties[index.row()];
|
||||||
switch (index.column()) {
|
switch (index.column()) {
|
||||||
case Column::Name: return Color::Black;
|
case Column::Name:
|
||||||
case Column::Value: return property.is_readonly() ? Color(Color::MidGray) : Color(Color::Black);
|
return Color::Black;
|
||||||
|
case Column::Value:
|
||||||
|
return property.is_readonly() ? Color(Color::MidGray) : Color(Color::Black);
|
||||||
}
|
}
|
||||||
ASSERT_NOT_REACHED();
|
ASSERT_NOT_REACHED();
|
||||||
}
|
}
|
||||||
|
|
|
@ -1,5 +1,5 @@
|
||||||
#include "VBProperty.h"
|
|
||||||
#include "VBWidgetRegistry.h"
|
#include "VBWidgetRegistry.h"
|
||||||
|
#include "VBProperty.h"
|
||||||
#include <LibGUI/GButton.h>
|
#include <LibGUI/GButton.h>
|
||||||
#include <LibGUI/GCheckBox.h>
|
#include <LibGUI/GCheckBox.h>
|
||||||
#include <LibGUI/GGroupBox.h>
|
#include <LibGUI/GGroupBox.h>
|
||||||
|
@ -14,18 +14,30 @@
|
||||||
static String to_class_name(VBWidgetType type)
|
static String to_class_name(VBWidgetType type)
|
||||||
{
|
{
|
||||||
switch (type) {
|
switch (type) {
|
||||||
case VBWidgetType::GWidget: return "GWidget";
|
case VBWidgetType::GWidget:
|
||||||
case VBWidgetType::GButton: return "GButton";
|
return "GWidget";
|
||||||
case VBWidgetType::GLabel: return "GLabel";
|
case VBWidgetType::GButton:
|
||||||
case VBWidgetType::GSpinBox: return "GSpinBox";
|
return "GButton";
|
||||||
case VBWidgetType::GTextEditor: return "GTextEditor";
|
case VBWidgetType::GLabel:
|
||||||
case VBWidgetType::GProgressBar: return "GProgressBar";
|
return "GLabel";
|
||||||
case VBWidgetType::GCheckBox: return "GCheckBox";
|
case VBWidgetType::GSpinBox:
|
||||||
case VBWidgetType::GRadioButton: return "GRadioButton";
|
return "GSpinBox";
|
||||||
case VBWidgetType::GScrollBar: return "GScrollBar";
|
case VBWidgetType::GTextEditor:
|
||||||
case VBWidgetType::GGroupBox: return "GGroupBox";
|
return "GTextEditor";
|
||||||
case VBWidgetType::GSlider: return "GSlider";
|
case VBWidgetType::GProgressBar:
|
||||||
default: ASSERT_NOT_REACHED();
|
return "GProgressBar";
|
||||||
|
case VBWidgetType::GCheckBox:
|
||||||
|
return "GCheckBox";
|
||||||
|
case VBWidgetType::GRadioButton:
|
||||||
|
return "GRadioButton";
|
||||||
|
case VBWidgetType::GScrollBar:
|
||||||
|
return "GScrollBar";
|
||||||
|
case VBWidgetType::GGroupBox:
|
||||||
|
return "GGroupBox";
|
||||||
|
case VBWidgetType::GSlider:
|
||||||
|
return "GSlider";
|
||||||
|
default:
|
||||||
|
ASSERT_NOT_REACHED();
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
|
@ -1,19 +1,19 @@
|
||||||
#include <LibGUI/GWindow.h>
|
|
||||||
#include <LibGUI/GWidget.h>
|
|
||||||
#include <LibGUI/GBoxLayout.h>
|
|
||||||
#include <LibGUI/GApplication.h>
|
|
||||||
#include <LibGUI/GMenuBar.h>
|
|
||||||
#include <LibGUI/GAction.h>
|
|
||||||
#include <LibGUI/GButton.h>
|
|
||||||
#include <LibGUI/GTableView.h>
|
|
||||||
#include "VBForm.h"
|
#include "VBForm.h"
|
||||||
|
#include "VBPropertiesWindow.h"
|
||||||
#include "VBWidget.h"
|
#include "VBWidget.h"
|
||||||
#include "VBWidgetPropertyModel.h"
|
#include "VBWidgetPropertyModel.h"
|
||||||
#include "VBPropertiesWindow.h"
|
#include <LibGUI/GAction.h>
|
||||||
#include <unistd.h>
|
#include <LibGUI/GApplication.h>
|
||||||
#include <stdio.h>
|
#include <LibGUI/GBoxLayout.h>
|
||||||
#include <signal.h>
|
#include <LibGUI/GButton.h>
|
||||||
|
#include <LibGUI/GMenuBar.h>
|
||||||
|
#include <LibGUI/GTableView.h>
|
||||||
|
#include <LibGUI/GWidget.h>
|
||||||
|
#include <LibGUI/GWindow.h>
|
||||||
#include <fcntl.h>
|
#include <fcntl.h>
|
||||||
|
#include <signal.h>
|
||||||
|
#include <stdio.h>
|
||||||
|
#include <unistd.h>
|
||||||
|
|
||||||
static GWindow* make_toolbox_window();
|
static GWindow* make_toolbox_window();
|
||||||
|
|
||||||
|
|
Loading…
Add table
Add a link
Reference in a new issue