mirror of
https://github.com/RGBCube/serenity
synced 2025-06-01 11:28:11 +00:00
Meta: Tweak .clang-format to not wrap braces after enums.
This commit is contained in:
parent
9145917bf0
commit
39d1a9ae66
97 changed files with 186 additions and 312 deletions
|
@ -18,8 +18,7 @@ class GWidget;
|
|||
class GAction : public Retainable<GAction>
|
||||
, public Weakable<GAction> {
|
||||
public:
|
||||
enum class ShortcutScope
|
||||
{
|
||||
enum class ShortcutScope {
|
||||
None,
|
||||
ApplicationGlobal,
|
||||
WidgetLocal,
|
||||
|
|
|
@ -5,8 +5,7 @@
|
|||
|
||||
class GDialog : public GWindow {
|
||||
public:
|
||||
enum ExecResult
|
||||
{
|
||||
enum ExecResult {
|
||||
ExecOK = 0,
|
||||
ExecCancel = 1,
|
||||
ExecAborted = 2
|
||||
|
|
|
@ -11,8 +11,7 @@ public:
|
|||
static Retained<GDirectoryModel> create() { return adopt(*new GDirectoryModel); }
|
||||
virtual ~GDirectoryModel() override;
|
||||
|
||||
enum Column
|
||||
{
|
||||
enum Column {
|
||||
Icon = 0,
|
||||
Name,
|
||||
Size,
|
||||
|
|
|
@ -10,8 +10,7 @@ class CObject;
|
|||
|
||||
class GEvent : public CEvent {
|
||||
public:
|
||||
enum Type
|
||||
{
|
||||
enum Type {
|
||||
Show = 1000,
|
||||
Hide,
|
||||
Paint,
|
||||
|
@ -218,8 +217,7 @@ public:
|
|||
}
|
||||
};
|
||||
|
||||
enum GMouseButton : byte
|
||||
{
|
||||
enum GMouseButton : byte {
|
||||
None = 0,
|
||||
Left = 1,
|
||||
Right = 2,
|
||||
|
|
|
@ -11,8 +11,7 @@ struct GFileSystemModel::Node {
|
|||
String name;
|
||||
Node* parent { nullptr };
|
||||
Vector<Node*> children;
|
||||
enum Type
|
||||
{
|
||||
enum Type {
|
||||
Unknown,
|
||||
Directory,
|
||||
File
|
||||
|
|
|
@ -6,8 +6,7 @@ class GFileSystemModel : public GModel {
|
|||
friend class Node;
|
||||
|
||||
public:
|
||||
enum Mode
|
||||
{
|
||||
enum Mode {
|
||||
Invalid,
|
||||
DirectoriesOnly,
|
||||
FilesAndDirectories
|
||||
|
|
|
@ -32,8 +32,7 @@ public:
|
|||
|
||||
protected:
|
||||
struct Entry {
|
||||
enum class Type
|
||||
{
|
||||
enum class Type {
|
||||
Invalid = 0,
|
||||
Widget,
|
||||
Layout,
|
||||
|
|
|
@ -8,8 +8,7 @@ class GMenu;
|
|||
|
||||
class GMenuItem {
|
||||
public:
|
||||
enum Type
|
||||
{
|
||||
enum Type {
|
||||
Invalid,
|
||||
Action,
|
||||
Separator
|
||||
|
|
|
@ -4,8 +4,7 @@
|
|||
|
||||
class GMessageBox : public GDialog {
|
||||
public:
|
||||
enum class Type
|
||||
{
|
||||
enum class Type {
|
||||
None,
|
||||
Information,
|
||||
Warning,
|
||||
|
|
|
@ -12,8 +12,7 @@
|
|||
class Font;
|
||||
class GAbstractView;
|
||||
|
||||
enum class GSortOrder
|
||||
{
|
||||
enum class GSortOrder {
|
||||
None,
|
||||
Ascending,
|
||||
Descending
|
||||
|
@ -21,8 +20,7 @@ enum class GSortOrder
|
|||
|
||||
class GModelNotification {
|
||||
public:
|
||||
enum Type
|
||||
{
|
||||
enum Type {
|
||||
Invalid = 0,
|
||||
ModelUpdated,
|
||||
};
|
||||
|
@ -49,8 +47,7 @@ public:
|
|||
const Font* font { nullptr };
|
||||
};
|
||||
|
||||
enum class Role
|
||||
{
|
||||
enum class Role {
|
||||
Display,
|
||||
Sort,
|
||||
Custom,
|
||||
|
|
|
@ -19,8 +19,7 @@ public:
|
|||
String caption() const { return m_caption; }
|
||||
void set_caption(const StringView& caption) { m_caption = caption; }
|
||||
|
||||
enum Format
|
||||
{
|
||||
enum Format {
|
||||
NoText,
|
||||
Percentage,
|
||||
ValueSlashMax
|
||||
|
|
|
@ -29,8 +29,7 @@ public:
|
|||
|
||||
virtual const char* class_name() const override { return "GScrollBar"; }
|
||||
|
||||
enum Component
|
||||
{
|
||||
enum Component {
|
||||
Invalid,
|
||||
DecrementButton,
|
||||
IncrementButton,
|
||||
|
@ -72,8 +71,7 @@ private:
|
|||
Orientation m_orientation { Orientation::Vertical };
|
||||
Component m_hovered_component { Component::Invalid };
|
||||
|
||||
enum class AutomaticScrollingDirection
|
||||
{
|
||||
enum class AutomaticScrollingDirection {
|
||||
None = 0,
|
||||
Decrement,
|
||||
Increment,
|
||||
|
|
|
@ -46,7 +46,7 @@ void GStackWidget::child_event(CChildEvent& event)
|
|||
GWidget* new_active_widget = nullptr;
|
||||
for_each_child_widget([&](auto& new_child) {
|
||||
new_active_widget = &new_child;
|
||||
return IterationDecision::Abort;
|
||||
return IterationDecision::Break;
|
||||
});
|
||||
set_active_widget(new_active_widget);
|
||||
}
|
||||
|
|
|
@ -63,7 +63,7 @@ void GTabWidget::child_event(CChildEvent& event)
|
|||
GWidget* new_active_widget = nullptr;
|
||||
for_each_child_widget([&](auto& new_child) {
|
||||
new_active_widget = &new_child;
|
||||
return IterationDecision::Abort;
|
||||
return IterationDecision::Break;
|
||||
});
|
||||
set_active_widget(new_active_widget);
|
||||
}
|
||||
|
|
|
@ -78,8 +78,7 @@ private:
|
|||
|
||||
class GTextEditor : public GScrollableWidget {
|
||||
public:
|
||||
enum Type
|
||||
{
|
||||
enum Type {
|
||||
MultiLine,
|
||||
SingleLine
|
||||
};
|
||||
|
|
|
@ -21,8 +21,7 @@ private:
|
|||
virtual void paint_event(GPaintEvent&) override;
|
||||
|
||||
struct Item {
|
||||
enum Type
|
||||
{
|
||||
enum Type {
|
||||
Invalid,
|
||||
Separator,
|
||||
Action
|
||||
|
|
|
@ -44,12 +44,12 @@ GModelIndex GTreeView::index_at_content_position(const Point& position, bool& is
|
|||
traverse_in_paint_order([&](const GModelIndex& index, const Rect& rect, const Rect& toggle_rect, int) {
|
||||
if (rect.contains(position)) {
|
||||
result = index;
|
||||
return IterationDecision::Abort;
|
||||
return IterationDecision::Break;
|
||||
}
|
||||
if (toggle_rect.contains(position)) {
|
||||
result = index;
|
||||
is_toggle = true;
|
||||
return IterationDecision::Abort;
|
||||
return IterationDecision::Break;
|
||||
}
|
||||
return IterationDecision::Continue;
|
||||
});
|
||||
|
@ -104,8 +104,8 @@ void GTreeView::traverse_in_paint_order(Callback callback) const
|
|||
toggle_rect = { toggle_x, rect.y(), toggle_size(), toggle_size() };
|
||||
toggle_rect.center_vertically_within(rect);
|
||||
}
|
||||
if (callback(index, rect, toggle_rect, indent_level) == IterationDecision::Abort)
|
||||
return IterationDecision::Abort;
|
||||
if (callback(index, rect, toggle_rect, indent_level) == IterationDecision::Break)
|
||||
return IterationDecision::Break;
|
||||
y_offset += item_height();
|
||||
// NOTE: Skip traversing children if this index is closed!
|
||||
if (!metadata.open)
|
||||
|
@ -115,8 +115,8 @@ void GTreeView::traverse_in_paint_order(Callback callback) const
|
|||
++indent_level;
|
||||
int row_count = model.row_count(index);
|
||||
for (int i = 0; i < row_count; ++i) {
|
||||
if (traverse_index(model.index(i, 0, index)) == IterationDecision::Abort)
|
||||
return IterationDecision::Abort;
|
||||
if (traverse_index(model.index(i, 0, index)) == IterationDecision::Break)
|
||||
return IterationDecision::Break;
|
||||
}
|
||||
--indent_level;
|
||||
return IterationDecision::Continue;
|
||||
|
@ -205,7 +205,7 @@ void GTreeView::scroll_into_view(const GModelIndex& a_index, Orientation orienta
|
|||
traverse_in_paint_order([&](const GModelIndex& index, const Rect& rect, const Rect&, int) {
|
||||
if (index == a_index) {
|
||||
found_rect = rect;
|
||||
return IterationDecision::Abort;
|
||||
return IterationDecision::Break;
|
||||
}
|
||||
return IterationDecision::Continue;
|
||||
});
|
||||
|
@ -270,7 +270,7 @@ void GTreeView::keydown_event(GKeyEvent& event)
|
|||
traverse_in_paint_order([&](const GModelIndex& index, const Rect&, const Rect&, int) {
|
||||
if (index == cursor_index) {
|
||||
found_index = previous_index;
|
||||
return IterationDecision::Abort;
|
||||
return IterationDecision::Break;
|
||||
}
|
||||
previous_index = index;
|
||||
return IterationDecision::Continue;
|
||||
|
@ -287,7 +287,7 @@ void GTreeView::keydown_event(GKeyEvent& event)
|
|||
traverse_in_paint_order([&](const GModelIndex& index, const Rect&, const Rect&, int) {
|
||||
if (previous_index == cursor_index) {
|
||||
found_index = index;
|
||||
return IterationDecision::Abort;
|
||||
return IterationDecision::Break;
|
||||
}
|
||||
previous_index = index;
|
||||
return IterationDecision::Continue;
|
||||
|
|
|
@ -27,8 +27,7 @@ public:
|
|||
void clear();
|
||||
~GVariant();
|
||||
|
||||
enum class Type
|
||||
{
|
||||
enum class Type {
|
||||
Invalid,
|
||||
Bool,
|
||||
Int,
|
||||
|
|
|
@ -17,23 +17,19 @@ class GLayout;
|
|||
class GMenu;
|
||||
class GWindow;
|
||||
|
||||
enum class SizePolicy
|
||||
{
|
||||
enum class SizePolicy {
|
||||
Fixed,
|
||||
Fill
|
||||
};
|
||||
enum class Orientation
|
||||
{
|
||||
enum class Orientation {
|
||||
Horizontal,
|
||||
Vertical
|
||||
};
|
||||
enum class HorizontalDirection
|
||||
{
|
||||
enum class HorizontalDirection {
|
||||
Left,
|
||||
Right
|
||||
};
|
||||
enum class VerticalDirection
|
||||
{
|
||||
enum class VerticalDirection {
|
||||
Up,
|
||||
Down
|
||||
};
|
||||
|
|
|
@ -10,8 +10,7 @@
|
|||
class GWidget;
|
||||
class GWMEvent;
|
||||
|
||||
enum class GStandardCursor
|
||||
{
|
||||
enum class GStandardCursor {
|
||||
None = 0,
|
||||
Arrow,
|
||||
IBeam,
|
||||
|
|
|
@ -1,7 +1,6 @@
|
|||
#pragma once
|
||||
|
||||
enum class GWindowType
|
||||
{
|
||||
enum class GWindowType {
|
||||
Invalid = 0,
|
||||
Normal,
|
||||
Menu,
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue