upgraded to uncrustify 0.76.0 - still not happy with the C++ beautifier
situation, that requires way too much manual post processing
This commit is contained in:
parent
9b2c2a8f12
commit
a6bf60c9b4
381
.uncrustify
381
.uncrustify
|
|
@ -1,3 +1,5 @@
|
|||
# Uncrustify-0.76.0_f
|
||||
|
||||
#
|
||||
# General options
|
||||
#
|
||||
|
|
@ -100,7 +102,7 @@ sp_cpp_lambda_square_brace = force # ignore/add/remove/force/not_defined
|
|||
# Add or remove space after the opening parenthesis and before the closing
|
||||
# parenthesis of a argument list of a C++11 lambda, as in
|
||||
# '[]( <here> int x <here> ){ ... }'.
|
||||
sp_cpp_lambda_argument_list = force # ignore/add/remove/force/not_defined
|
||||
sp_cpp_lambda_argument_list = ignore # ignore/add/remove/force/not_defined
|
||||
|
||||
# Add or remove space after the argument list of a C++11 lambda, as in
|
||||
# '[](int x) <here> { ... }'.
|
||||
|
|
@ -125,6 +127,11 @@ sp_before_assign = ignore # ignore/add/remove/force/not_defined
|
|||
# Overrides sp_assign.
|
||||
sp_after_assign = ignore # ignore/add/remove/force/not_defined
|
||||
|
||||
# Add or remove space in 'enum {'.
|
||||
#
|
||||
# Default: add
|
||||
sp_enum_brace = add # ignore/add/remove/force/not_defined
|
||||
|
||||
# Add or remove space in 'NS_ENUM ('.
|
||||
sp_enum_paren = ignore # ignore/add/remove/force/not_defined
|
||||
|
||||
|
|
@ -216,6 +223,10 @@ sp_after_ptr_star_trailing = ignore # ignore/add/remove/force/not_defined
|
|||
# in a function pointer definition.
|
||||
sp_ptr_star_func_var = ignore # ignore/add/remove/force/not_defined
|
||||
|
||||
# Add or remove space between the pointer star '*' and the name of the type
|
||||
# in a function pointer type definition.
|
||||
sp_ptr_star_func_type = force # ignore/add/remove/force/not_defined
|
||||
|
||||
# Add or remove space after a pointer star '*', if followed by an open
|
||||
# parenthesis, as in 'void* (*)()'.
|
||||
sp_ptr_star_paren = force # ignore/add/remove/force/not_defined
|
||||
|
|
@ -250,6 +261,10 @@ sp_after_byref_func = force # ignore/add/remove/force/not_defined
|
|||
# prototype or function definition.
|
||||
sp_before_byref_func = remove # ignore/add/remove/force/not_defined
|
||||
|
||||
# Add or remove space after a reference sign '&', if followed by an open
|
||||
# parenthesis, as in 'char& (*)()'.
|
||||
sp_byref_paren = force # ignore/add/remove/force/not_defined
|
||||
|
||||
# Add or remove space between type and word. In cases where total removal of
|
||||
# whitespace would be a syntax error, a value of 'remove' is treated the same
|
||||
# as 'force'.
|
||||
|
|
@ -432,15 +447,15 @@ sp_after_comma = ignore # ignore/add/remove/force/not_defined
|
|||
# Default: remove
|
||||
sp_before_comma = remove # ignore/add/remove/force/not_defined
|
||||
|
||||
# (C#) Add or remove space between ',' and ']' in multidimensional array type
|
||||
# (C#, Vala) Add or remove space between ',' and ']' in multidimensional array type
|
||||
# like 'int[,,]'.
|
||||
sp_after_mdatype_commas = ignore # ignore/add/remove/force/not_defined
|
||||
|
||||
# (C#) Add or remove space between '[' and ',' in multidimensional array type
|
||||
# (C#, Vala) Add or remove space between '[' and ',' in multidimensional array type
|
||||
# like 'int[,,]'.
|
||||
sp_before_mdatype_commas = ignore # ignore/add/remove/force/not_defined
|
||||
|
||||
# (C#) Add or remove space between ',' in multidimensional array type
|
||||
# (C#, Vala) Add or remove space between ',' in multidimensional array type
|
||||
# like 'int[,,]'.
|
||||
sp_between_mdatype_commas = ignore # ignore/add/remove/force/not_defined
|
||||
|
||||
|
|
@ -450,14 +465,17 @@ sp_between_mdatype_commas = ignore # ignore/add/remove/force/not_defined
|
|||
# Default: force
|
||||
sp_paren_comma = force # ignore/add/remove/force/not_defined
|
||||
|
||||
# Add or remove space between a type and ':'.
|
||||
sp_type_colon = force # ignore/add/remove/force/not_defined
|
||||
|
||||
# Add or remove space after the variadic '...' when preceded by a
|
||||
# non-punctuator.
|
||||
# The value REMOVE will be overriden with FORCE
|
||||
# The value REMOVE will be overridden with FORCE
|
||||
sp_after_ellipsis = add # ignore/add/remove/force/not_defined
|
||||
|
||||
# Add or remove space before the variadic '...' when preceded by a
|
||||
# non-punctuator.
|
||||
# The value REMOVE will be overriden with FORCE
|
||||
# The value REMOVE will be overridden with FORCE
|
||||
sp_before_ellipsis = add # ignore/add/remove/force/not_defined
|
||||
|
||||
# Add or remove space between a type and '...'.
|
||||
|
|
@ -466,9 +484,6 @@ sp_type_ellipsis = add # ignore/add/remove/force/not_defined
|
|||
# Add or remove space between a '*' and '...'.
|
||||
sp_ptr_type_ellipsis = ignore # ignore/add/remove/force/not_defined
|
||||
|
||||
# (D) Add or remove space between a type and '?'.
|
||||
sp_type_question = ignore # ignore/add/remove/force/not_defined
|
||||
|
||||
# Add or remove space between ')' and '...'.
|
||||
sp_paren_ellipsis = add # ignore/add/remove/force/not_defined
|
||||
|
||||
|
|
@ -788,6 +803,10 @@ sp_d_array_colon = ignore # ignore/add/remove/force/not_defined
|
|||
# Default: remove
|
||||
sp_not = remove # ignore/add/remove/force/not_defined
|
||||
|
||||
# Add or remove space between two '!' (not) unary operators.
|
||||
# If set to ignore, sp_not will be used.
|
||||
sp_not_not = ignore # ignore/add/remove/force/not_defined
|
||||
|
||||
# Add or remove space after the '~' (invert) unary operator.
|
||||
#
|
||||
# Default: remove
|
||||
|
|
@ -976,7 +995,7 @@ sp_between_new_paren = ignore # ignore/add/remove/force/not_defined
|
|||
# Add or remove space between ')' and type in 'new(foo) BAR'.
|
||||
sp_after_newop_paren = force # ignore/add/remove/force/not_defined
|
||||
|
||||
# Add or remove space inside parenthesis of the new operator
|
||||
# Add or remove space inside parentheses of the new operator
|
||||
# as in 'new(foo) BAR'.
|
||||
sp_inside_newop_paren = force # ignore/add/remove/force/not_defined
|
||||
|
||||
|
|
@ -1042,15 +1061,21 @@ force_tab_after_define = false # true/false
|
|||
# Default: 8
|
||||
indent_columns = 4 # unsigned number
|
||||
|
||||
# Whether to ignore indent for the first continuation line. Subsequent
|
||||
# continuation lines will still be indented to match the first.
|
||||
indent_ignore_first_continue = false # true/false
|
||||
|
||||
# The continuation indent. If non-zero, this overrides the indent of '(', '['
|
||||
# and '=' continuation indents. Negative values are OK; negative value is
|
||||
# absolute and not increased for each '(' or '[' level.
|
||||
#
|
||||
# For FreeBSD, this is set to 4.
|
||||
indent_continue = 4 # number
|
||||
# Requires indent_ignore_first_continue=false.
|
||||
indent_continue = 0 # number
|
||||
|
||||
# The continuation indent, only for class header line(s). If non-zero, this
|
||||
# overrides the indent of 'class' continuation indents.
|
||||
# Requires indent_ignore_first_continue=false.
|
||||
indent_continue_class_head = 0 # unsigned number
|
||||
|
||||
# Whether to indent empty lines (i.e. lines which contain only spaces before
|
||||
|
|
@ -1059,7 +1084,7 @@ indent_single_newlines = false # true/false
|
|||
|
||||
# The continuation indent for func_*_param if they are true. If non-zero, this
|
||||
# overrides the indent.
|
||||
indent_param = 4 # unsigned number
|
||||
indent_param = 0 # unsigned number
|
||||
|
||||
# How to use tabs when indenting code.
|
||||
#
|
||||
|
|
@ -1126,16 +1151,23 @@ indent_namespace_level = 0 # unsigned number
|
|||
# indented. Requires indent_namespace=true. 0 means no limit.
|
||||
indent_namespace_limit = 0 # unsigned number
|
||||
|
||||
# Whether to indent only in inner namespaces (nested in other namespaces).
|
||||
# Requires indent_namespace=true.
|
||||
indent_namespace_inner_only = false # true/false
|
||||
|
||||
# Whether the 'extern "C"' body is indented.
|
||||
indent_extern = true # true/false
|
||||
|
||||
# Whether the 'class' body is indented.
|
||||
indent_class = true # true/false
|
||||
|
||||
# Whether to ignore indent for the leading base class colon.
|
||||
indent_ignore_before_class_colon = false # true/false
|
||||
|
||||
# Additional indent before the leading base class colon.
|
||||
# Negative values decrease indent down to the first column.
|
||||
# Requires a newline break before colon (see pos_class_colon
|
||||
# and nl_class_colon)
|
||||
# Requires indent_ignore_before_class_colon=false and a newline break before
|
||||
# the colon (see pos_class_colon and nl_class_colon)
|
||||
indent_before_class_colon = 0 # number
|
||||
|
||||
# Whether to indent the stuff after a leading base class colon.
|
||||
|
|
@ -1145,6 +1177,9 @@ indent_class_colon = false # true/false
|
|||
# colon. Requires indent_class_colon=true.
|
||||
indent_class_on_colon = false # true/false
|
||||
|
||||
# Whether to ignore indent for a leading class initializer colon.
|
||||
indent_ignore_before_constr_colon = false # true/false
|
||||
|
||||
# Whether to indent the stuff after a leading class initializer colon.
|
||||
indent_constr_colon = false # true/false
|
||||
|
||||
|
|
@ -1175,9 +1210,12 @@ indent_var_def_blk = 0 # number
|
|||
# Whether to indent continued variable declarations instead of aligning.
|
||||
indent_var_def_cont = true # true/false
|
||||
|
||||
# Whether to indent continued shift expressions ('<<' and '>>') instead of
|
||||
# aligning. Set align_left_shift=false when enabling this.
|
||||
indent_shift = true # true/false
|
||||
# How to indent continued shift expressions ('<<' and '>>').
|
||||
# Set align_left_shift=false when using this.
|
||||
# 0: Align shift operators instead of indenting them (default)
|
||||
# 1: Indent by one level
|
||||
# -1: Preserve original indentation
|
||||
indent_shift = 0 # number
|
||||
|
||||
# Whether to force indentation of function definitions to start in column 1.
|
||||
indent_func_def_force_col1 = false # true/false
|
||||
|
|
@ -1194,7 +1232,7 @@ indent_func_def_param = true # true/false
|
|||
# Allows to align params when appropriate and indent them when not
|
||||
# behave as if it was true if paren position is more than this value
|
||||
# if paren position is more than the option value
|
||||
indent_func_def_param_paren_pos_threshold = 0 # unsigned number
|
||||
indent_func_def_param_paren_pos_threshold = 4 # unsigned number
|
||||
|
||||
# Whether to indent continued function call prototype one indent level,
|
||||
# rather than aligning parameters under the open parenthesis.
|
||||
|
|
@ -1240,7 +1278,7 @@ indent_member = 4 # unsigned number
|
|||
|
||||
# Whether lines broken at '.' or '->' should be indented by a single indent.
|
||||
# The indent_member option will not be effective if this is set to true.
|
||||
indent_member_single = true # true/false
|
||||
indent_member_single = false # true/false
|
||||
|
||||
# Spaces to indent single line ('//') comments on lines before code.
|
||||
indent_single_line_comments_before = 0 # unsigned number
|
||||
|
|
@ -1264,6 +1302,9 @@ indent_switch_case = 4 # unsigned number
|
|||
# Usually the same as indent_columns or indent_switch_case.
|
||||
indent_switch_body = 0 # unsigned number
|
||||
|
||||
# Whether to ignore indent for '{' following 'case'.
|
||||
indent_ignore_case_brace = true # true/false
|
||||
|
||||
# Spaces to indent '{' from 'case'. By default, the brace will appear under
|
||||
# the 'c' in case. Usually set to 0 or indent_columns. Negative values are OK.
|
||||
# It might be wise to choose the same value for the option indent_switch_case.
|
||||
|
|
@ -1335,7 +1376,8 @@ indent_paren_nl = false # true/false
|
|||
# 0: Indent to body level (default)
|
||||
# 1: Align under the open parenthesis
|
||||
# 2: Indent to the brace level
|
||||
indent_paren_close = 0 # unsigned number
|
||||
# -1: Preserve original indentation
|
||||
indent_paren_close = 0 # number
|
||||
|
||||
# Whether to indent the open parenthesis of a function definition,
|
||||
# if the parenthesis is on its own line.
|
||||
|
|
@ -1349,24 +1391,41 @@ indent_paren_after_func_decl = false # true/false
|
|||
# if the parenthesis is on its own line.
|
||||
indent_paren_after_func_call = false # true/false
|
||||
|
||||
# Whether to indent a comma when inside a brace.
|
||||
# If true, aligns under the open brace.
|
||||
indent_comma_brace = false # true/false
|
||||
# How to indent a comma when inside braces.
|
||||
# 0: Indent by one level (default)
|
||||
# 1: Align under the open brace
|
||||
# -1: Preserve original indentation
|
||||
indent_comma_brace = 0 # number
|
||||
|
||||
# Whether to indent a comma when inside a parenthesis.
|
||||
# If true, aligns under the open parenthesis.
|
||||
indent_comma_paren = false # true/false
|
||||
# How to indent a comma when inside parentheses.
|
||||
# 0: Indent by one level (default)
|
||||
# 1: Align under the open parenthesis
|
||||
# -1: Preserve original indentation
|
||||
indent_comma_paren = 0 # number
|
||||
|
||||
# Whether to indent a Boolean operator when inside a parenthesis.
|
||||
# If true, aligns under the open parenthesis.
|
||||
indent_bool_paren = false # true/false
|
||||
# How to indent a Boolean operator when inside parentheses.
|
||||
# 0: Indent by one level (default)
|
||||
# 1: Align under the open parenthesis
|
||||
# -1: Preserve original indentation
|
||||
indent_bool_paren = 0 # number
|
||||
|
||||
# Whether to ignore the indentation of a Boolean operator when outside
|
||||
# parentheses.
|
||||
indent_ignore_bool = false # true/false
|
||||
|
||||
# Whether to ignore the indentation of an arithmetic operator.
|
||||
indent_ignore_arith = false # true/false
|
||||
|
||||
# Whether to indent a semicolon when inside a for parenthesis.
|
||||
# If true, aligns under the open for parenthesis.
|
||||
indent_semicolon_for_paren = false # true/false
|
||||
|
||||
# Whether to ignore the indentation of a semicolon outside of a 'for'
|
||||
# statement.
|
||||
indent_ignore_semicolon = false # true/false
|
||||
|
||||
# Whether to align the first expression to following ones
|
||||
# if indent_bool_paren=true.
|
||||
# if indent_bool_paren=1.
|
||||
indent_first_bool_expr = false # true/false
|
||||
|
||||
# Whether to align the first expression to following ones
|
||||
|
|
@ -1380,6 +1439,9 @@ indent_square_nl = false # true/false
|
|||
# (ESQL/C) Whether to preserve the relative indent of 'EXEC SQL' bodies.
|
||||
indent_preserve_sql = false # true/false
|
||||
|
||||
# Whether to ignore the indentation of an assignment operator.
|
||||
indent_ignore_assign = false # true/false
|
||||
|
||||
# Whether to align continued statements at the '='. If false or if the '=' is
|
||||
# followed by a newline, the next line is indent one tab.
|
||||
#
|
||||
|
|
@ -1475,7 +1537,7 @@ indent_using_block = true # true/false
|
|||
# How to indent the continuation of ternary operator.
|
||||
#
|
||||
# 0: Off (default)
|
||||
# 1: When the `if_false` is a continuation, indent it under `if_false`
|
||||
# 1: When the `if_false` is a continuation, indent it under the `if_true` branch
|
||||
# 2: When the `:` is a continuation, indent it under `?`
|
||||
indent_ternary_operator = 0 # unsigned number
|
||||
|
||||
|
|
@ -1503,10 +1565,15 @@ donot_indent_func_def_close_paren = false # true/false
|
|||
# Newline adding and removing options
|
||||
#
|
||||
|
||||
# Whether to collapse empty blocks between '{' and '}'.
|
||||
# If true, overrides nl_inside_empty_func
|
||||
# Whether to collapse empty blocks between '{' and '}' except for functions.
|
||||
# Use nl_collapse_empty_body_functions to specify how empty function braces
|
||||
# should be formatted.
|
||||
nl_collapse_empty_body = false # true/false
|
||||
|
||||
# Whether to collapse empty blocks between '{' and '}' for functions only.
|
||||
# If true, overrides nl_inside_empty_func.
|
||||
nl_collapse_empty_body_functions = false # true/false
|
||||
|
||||
# Don't split one-line braced assignments, as in 'foo_t f = { 1, 2 };'.
|
||||
nl_assign_leave_one_liners = true # true/false
|
||||
|
||||
|
|
@ -1740,7 +1807,7 @@ nl_case_colon_brace = ignore # ignore/add/remove/force/not_defined
|
|||
nl_before_throw = ignore # ignore/add/remove/force/not_defined
|
||||
|
||||
# Add or remove newline between 'namespace' and '{'.
|
||||
nl_namespace_brace = ignore # ignore/add/remove/force/not_defined
|
||||
nl_namespace_brace = force # ignore/add/remove/force/not_defined
|
||||
|
||||
# Add or remove newline after 'template<...>' of a template class.
|
||||
nl_template_class = ignore # ignore/add/remove/force/not_defined
|
||||
|
|
@ -1959,6 +2026,12 @@ nl_template_end = false # true/false
|
|||
# See nl_oc_msg_leave_one_liner.
|
||||
nl_oc_msg_args = false # true/false
|
||||
|
||||
# (OC) Minimum number of Objective-C message parameters before applying nl_oc_msg_args.
|
||||
nl_oc_msg_args_min_params = 0 # unsigned number
|
||||
|
||||
# (OC) Max code width of Objective-C message before applying nl_oc_msg_args.
|
||||
nl_oc_msg_args_max_code_width = 0 # unsigned number
|
||||
|
||||
# Add or remove newline between function signature and '{'.
|
||||
nl_fdef_brace = ignore # ignore/add/remove/force/not_defined
|
||||
|
||||
|
|
@ -1972,6 +2045,9 @@ nl_cpp_ldef_brace = ignore # ignore/add/remove/force/not_defined
|
|||
# Add or remove newline between 'return' and the return expression.
|
||||
nl_return_expr = ignore # ignore/add/remove/force/not_defined
|
||||
|
||||
# Add or remove newline between 'throw' and the throw expression.
|
||||
nl_throw_expr = ignore # ignore/add/remove/force/not_defined
|
||||
|
||||
# Whether to add a newline after semicolons, except in 'for' statements.
|
||||
nl_after_semicolon = false # true/false
|
||||
|
||||
|
|
@ -1980,7 +2056,8 @@ nl_after_semicolon = false # true/false
|
|||
nl_paren_dbrace_open = ignore # ignore/add/remove/force/not_defined
|
||||
|
||||
# Whether to add a newline after the type in an unnamed temporary
|
||||
# direct-list-initialization.
|
||||
# direct-list-initialization, better:
|
||||
# before a direct-list-initialization.
|
||||
nl_type_brace_init_lst = ignore # ignore/add/remove/force/not_defined
|
||||
|
||||
# Whether to add a newline after the open brace in an unnamed temporary
|
||||
|
|
@ -2164,7 +2241,7 @@ nl_max_blank_in_func = 0 # unsigned number
|
|||
# The number of newlines inside an empty function body.
|
||||
# This option overrides eat_blanks_after_open_brace and
|
||||
# eat_blanks_before_close_brace, but is ignored when
|
||||
# nl_collapse_empty_body=true
|
||||
# nl_collapse_empty_body_functions=true
|
||||
nl_inside_empty_func = 0 # unsigned number
|
||||
|
||||
# The number of newlines before a function prototype.
|
||||
|
|
@ -2216,12 +2293,6 @@ nl_after_func_body_class = 0 # unsigned number
|
|||
# Overrides nl_after_func_body and nl_after_func_body_class.
|
||||
nl_after_func_body_one_liner = 0 # unsigned number
|
||||
|
||||
# The number of blank lines after a block of variable definitions at the top
|
||||
# of a function body.
|
||||
#
|
||||
# 0: No change (default).
|
||||
nl_func_var_def_blk = 0 # unsigned number
|
||||
|
||||
# The number of newlines before a block of typedefs. If nl_after_access_spec
|
||||
# is non-zero, that option takes precedence.
|
||||
#
|
||||
|
|
@ -2238,15 +2309,27 @@ nl_typedef_blk_end = 0 # unsigned number
|
|||
# 0: No change (default).
|
||||
nl_typedef_blk_in = 0 # unsigned number
|
||||
|
||||
# The number of newlines before a block of variable definitions not at the top
|
||||
# of a function body. If nl_after_access_spec is non-zero, that option takes
|
||||
# precedence.
|
||||
# The minimum number of blank lines after a block of variable definitions
|
||||
# at the top of a function body. If any preprocessor directives appear
|
||||
# between the opening brace of the function and the variable block, then
|
||||
# it is considered as not at the top of the function.Newlines are added
|
||||
# before trailing preprocessor directives, if any exist.
|
||||
#
|
||||
# 0: No change (default).
|
||||
nl_var_def_blk_end_func_top = 0 # unsigned number
|
||||
|
||||
# The minimum number of empty newlines before a block of variable definitions
|
||||
# not at the top of a function body. If nl_after_access_spec is non-zero,
|
||||
# that option takes precedence. Newlines are not added at the top of the
|
||||
# file or just after an opening brace. Newlines are added above any
|
||||
# preprocessor directives before the block.
|
||||
#
|
||||
# 0: No change (default).
|
||||
nl_var_def_blk_start = 0 # unsigned number
|
||||
|
||||
# The number of newlines after a block of variable definitions not at the top
|
||||
# of a function body.
|
||||
# The minimum number of empty newlines after a block of variable definitions
|
||||
# not at the top of a function body. Newlines are not added if the block
|
||||
# is at the bottom of the file or just before a preprocessor directive.
|
||||
#
|
||||
# 0: No change (default).
|
||||
nl_var_def_blk_end = 0 # unsigned number
|
||||
|
|
@ -2573,6 +2656,22 @@ align_assign_func_proto_span = 0 # unsigned number
|
|||
# 0: No limit (default).
|
||||
align_assign_thresh = 0 # number
|
||||
|
||||
# Whether to align on the left most assignment when multiple
|
||||
# definitions are found on the same line.
|
||||
# Depends on 'align_assign_span' and 'align_assign_thresh' settings.
|
||||
align_assign_on_multi_var_defs = false # true/false
|
||||
|
||||
# The span for aligning on '{' in braced init list.
|
||||
#
|
||||
# 0: Don't align (default).
|
||||
align_braced_init_list_span = 0 # unsigned number
|
||||
|
||||
# The threshold for aligning on '{' in braced init list.
|
||||
# Use a negative number for absolute thresholds.
|
||||
#
|
||||
# 0: No limit (default).
|
||||
align_braced_init_list_thresh = 0 # number
|
||||
|
||||
# How to apply align_assign_span to function declaration "assignments", i.e.
|
||||
# 'virtual void foo() = 0' or '~foo() = {default|delete}'.
|
||||
#
|
||||
|
|
@ -2778,7 +2877,7 @@ align_oc_decl_colon = false # true/false
|
|||
|
||||
# (OC) Whether to not align parameters in an Objectve-C message call if first
|
||||
# colon is not on next line of the message call (the same way Xcode does
|
||||
# aligment)
|
||||
# alignment)
|
||||
align_oc_msg_colon_xcode_like = false # true/false
|
||||
|
||||
#
|
||||
|
|
@ -2978,12 +3077,17 @@ mod_full_brace_function = ignore # ignore/add/remove/force/not_defined
|
|||
mod_full_brace_if = ignore # ignore/add/remove/force/not_defined
|
||||
|
||||
# Whether to enforce that all blocks of an 'if'/'else if'/'else' chain either
|
||||
# have, or do not have, braces. If true, braces will be added if any block
|
||||
# needs braces, and will only be removed if they can be removed from all
|
||||
# blocks.
|
||||
# have, or do not have, braces. Overrides mod_full_brace_if.
|
||||
#
|
||||
# Overrides mod_full_brace_if.
|
||||
mod_full_brace_if_chain = false # true/false
|
||||
# 0: Don't override mod_full_brace_if
|
||||
# 1: Add braces to all blocks if any block needs braces and remove braces if
|
||||
# they can be removed from all blocks
|
||||
# 2: Add braces to all blocks if any block already has braces, regardless of
|
||||
# whether it needs them
|
||||
# 3: Add braces to all blocks if any block needs braces and remove braces if
|
||||
# they can be removed from all blocks, except if all blocks have braces
|
||||
# despite none needing them
|
||||
mod_full_brace_if_chain = 0 # unsigned number
|
||||
|
||||
# Whether to add braces to all blocks of an 'if'/'else if'/'else' chain.
|
||||
# If true, mod_full_brace_if_chain will only remove braces from an 'if' that
|
||||
|
|
@ -3015,9 +3119,12 @@ mod_full_brace_nl = 0 # unsigned number
|
|||
# mod_full_brace_function
|
||||
mod_full_brace_nl_block_rem_mlcond = false # true/false
|
||||
|
||||
# Add or remove unnecessary parenthesis on 'return' statement.
|
||||
# Add or remove unnecessary parentheses on 'return' statement.
|
||||
mod_paren_on_return = ignore # ignore/add/remove/force/not_defined
|
||||
|
||||
# Add or remove unnecessary parentheses on 'throw' statement.
|
||||
mod_paren_on_throw = ignore # ignore/add/remove/force/not_defined
|
||||
|
||||
# (Pawn) Whether to change optional semicolons to real semicolons.
|
||||
mod_pawn_semicolon = false # true/false
|
||||
|
||||
|
|
@ -3025,6 +3132,14 @@ mod_pawn_semicolon = false # true/false
|
|||
# statement, as in 'if (a && b > c)' => 'if (a && (b > c))'.
|
||||
mod_full_paren_if_bool = false # true/false
|
||||
|
||||
# Whether to fully parenthesize Boolean expressions after '='
|
||||
# statement, as in 'x = a && b > c;' => 'x = (a && (b > c));'.
|
||||
mod_full_paren_assign_bool = false # true/false
|
||||
|
||||
# Whether to fully parenthesize Boolean expressions after '='
|
||||
# statement, as in 'return a && b > c;' => 'return (a && (b > c));'.
|
||||
mod_full_paren_return_bool = false # true/false
|
||||
|
||||
# Whether to remove superfluous semicolons.
|
||||
mod_remove_extra_semicolon = false # true/false
|
||||
|
||||
|
|
@ -3092,6 +3207,10 @@ mod_sort_incl_import_grouping_enabled = false # true/false
|
|||
# the close brace, as in 'case X: { ... } break;' => 'case X: { ... break; }'.
|
||||
mod_move_case_break = false # true/false
|
||||
|
||||
# Whether to move a 'return' that appears after a fully braced 'case' before
|
||||
# the close brace, as in 'case X: { ... } return;' => 'case X: { ... return; }'.
|
||||
mod_move_case_return = false # true/false
|
||||
|
||||
# Add or remove braces around a fully braced case statement. Will only remove
|
||||
# braces if there are no variable declarations in the block.
|
||||
mod_case_brace = ignore # ignore/add/remove/force/not_defined
|
||||
|
|
@ -3103,6 +3222,49 @@ mod_remove_empty_return = false # true/false
|
|||
# Add or remove the comma after the last value of an enumeration.
|
||||
mod_enum_last_comma = ignore # ignore/add/remove/force/not_defined
|
||||
|
||||
# Syntax to use for infinite loops.
|
||||
#
|
||||
# 0: Leave syntax alone (default)
|
||||
# 1: Rewrite as `for(;;)`
|
||||
# 2: Rewrite as `while(true)`
|
||||
# 3: Rewrite as `do`...`while(true);`
|
||||
# 4: Rewrite as `while(1)`
|
||||
# 5: Rewrite as `do`...`while(1);`
|
||||
#
|
||||
# Infinite loops that do not already match one of these syntaxes are ignored.
|
||||
# Other options that affect loop formatting will be applied after transforming
|
||||
# the syntax.
|
||||
mod_infinite_loop = 0 # unsigned number
|
||||
|
||||
# Add or remove the 'int' keyword in 'int short'.
|
||||
mod_int_short = ignore # ignore/add/remove/force/not_defined
|
||||
|
||||
# Add or remove the 'int' keyword in 'short int'.
|
||||
mod_short_int = ignore # ignore/add/remove/force/not_defined
|
||||
|
||||
# Add or remove the 'int' keyword in 'int long'.
|
||||
mod_int_long = ignore # ignore/add/remove/force/not_defined
|
||||
|
||||
# Add or remove the 'int' keyword in 'long int'.
|
||||
mod_long_int = ignore # ignore/add/remove/force/not_defined
|
||||
|
||||
# Add or remove the 'int' keyword in 'int signed'.
|
||||
mod_int_signed = ignore # ignore/add/remove/force/not_defined
|
||||
|
||||
# Add or remove the 'int' keyword in 'signed int'.
|
||||
mod_signed_int = ignore # ignore/add/remove/force/not_defined
|
||||
|
||||
# Add or remove the 'int' keyword in 'int unsigned'.
|
||||
mod_int_unsigned = ignore # ignore/add/remove/force/not_defined
|
||||
|
||||
# Add or remove the 'int' keyword in 'unsigned int'.
|
||||
mod_unsigned_int = ignore # ignore/add/remove/force/not_defined
|
||||
|
||||
# If there is a situation where mod_int_* and mod_*_int would result in
|
||||
# multiple int keywords, whether to keep the rightmost int (the default) or the
|
||||
# leftmost int.
|
||||
mod_int_prefer_int_on_left = false # true/false
|
||||
|
||||
# (OC) Whether to organize the properties. If true, properties will be
|
||||
# rearranged according to the mod_sort_oc_property_*_weight factors.
|
||||
mod_sort_oc_properties = false # true/false
|
||||
|
|
@ -3134,6 +3296,16 @@ mod_sort_oc_property_nullability_weight = 0 # number
|
|||
# Preprocessor options
|
||||
#
|
||||
|
||||
# How to use tabs when indenting preprocessor code.
|
||||
#
|
||||
# -1: Use 'indent_with_tabs' setting (default)
|
||||
# 0: Spaces only
|
||||
# 1: Indent with tabs to brace level, align with spaces
|
||||
# 2: Indent and align with tabs, using spaces when not on a tabstop
|
||||
#
|
||||
# Default: -1
|
||||
pp_indent_with_tabs = -1 # number
|
||||
|
||||
# Add or remove indentation of preprocessor directives inside #if blocks
|
||||
# at brace level 0 (file-level).
|
||||
pp_indent = ignore # ignore/add/remove/force/not_defined
|
||||
|
|
@ -3142,6 +3314,10 @@ pp_indent = ignore # ignore/add/remove/force/not_defined
|
|||
# indented from column 1.
|
||||
pp_indent_at_level = false # true/false
|
||||
|
||||
# Whether to indent #if/#else/#endif at the parenthesis level if the brace
|
||||
# level is 0. If false, these are indented from column 1.
|
||||
pp_indent_at_level0 = false # true/false
|
||||
|
||||
# Specifies the number of columns to indent preprocessors per level
|
||||
# at brace level 0 (file-level). If pp_indent_at_level=false, also specifies
|
||||
# the number of columns to indent preprocessors per level
|
||||
|
|
@ -3150,10 +3326,10 @@ pp_indent_at_level = false # true/false
|
|||
# Default: 1
|
||||
pp_indent_count = 1 # unsigned number
|
||||
|
||||
# Add or remove space after # based on pp_level of #if blocks.
|
||||
pp_space = ignore # ignore/add/remove/force/not_defined
|
||||
# Add or remove space after # based on pp level of #if blocks.
|
||||
pp_space_after = ignore # ignore/add/remove/force/not_defined
|
||||
|
||||
# Sets the number of spaces per level added with pp_space.
|
||||
# Sets the number of spaces per level added with pp_space_after.
|
||||
pp_space_count = 0 # unsigned number
|
||||
|
||||
# The indent for '#region' and '#endregion' in C# and '#pragma region' in
|
||||
|
|
@ -3186,33 +3362,70 @@ pp_include_at_level = false # true/false
|
|||
# Whether to ignore the '#define' body while formatting.
|
||||
pp_ignore_define_body = false # true/false
|
||||
|
||||
# An offset value that controls the indentation of the body of a multiline #define.
|
||||
# 'body' refers to all the lines of a multiline #define except the first line.
|
||||
# Requires 'pp_ignore_define_body = false'.
|
||||
#
|
||||
# <0: Absolute column: the body indentation starts off at the specified column
|
||||
# (ex. -3 ==> the body is indented starting from column 3)
|
||||
# >=0: Relative to the column of the '#' of '#define'
|
||||
# (ex. 3 ==> the body is indented starting 3 columns at the right of '#')
|
||||
#
|
||||
# Default: 8
|
||||
pp_multiline_define_body_indent = 8 # number
|
||||
|
||||
# Whether to indent case statements between #if, #else, and #endif.
|
||||
# Only applies to the indent of the preprocesser that the case statements
|
||||
# Only applies to the indent of the preprocessor that the case statements
|
||||
# directly inside of.
|
||||
#
|
||||
# Default: true
|
||||
pp_indent_case = true # true/false
|
||||
|
||||
# Whether to indent whole function definitions between #if, #else, and #endif.
|
||||
# Only applies to the indent of the preprocesser that the function definition
|
||||
# Only applies to the indent of the preprocessor that the function definition
|
||||
# is directly inside of.
|
||||
#
|
||||
# Default: true
|
||||
pp_indent_func_def = true # true/false
|
||||
|
||||
# Whether to indent extern C blocks between #if, #else, and #endif.
|
||||
# Only applies to the indent of the preprocesser that the extern block is
|
||||
# Only applies to the indent of the preprocessor that the extern block is
|
||||
# directly inside of.
|
||||
#
|
||||
# Default: true
|
||||
pp_indent_extern = true # true/false
|
||||
|
||||
# Whether to indent braces directly inside #if, #else, and #endif.
|
||||
# Only applies to the indent of the preprocesser that the braces are directly
|
||||
# inside of.
|
||||
# How to indent braces directly inside #if, #else, and #endif.
|
||||
# Requires pp_if_indent_code=true and only applies to the indent of the
|
||||
# preprocessor that the braces are directly inside of.
|
||||
# 0: No extra indent
|
||||
# 1: Indent by one level
|
||||
# -1: Preserve original indentation
|
||||
#
|
||||
# Default: true
|
||||
pp_indent_brace = true # true/false
|
||||
# Default: 1
|
||||
pp_indent_brace = 1 # number
|
||||
|
||||
# Whether to print warning messages for unbalanced #if and #else blocks.
|
||||
# This will print a message in the following cases:
|
||||
# - if an #ifdef block ends on a different indent level than
|
||||
# where it started from. Example:
|
||||
#
|
||||
# #ifdef TEST
|
||||
# int i;
|
||||
# {
|
||||
# int j;
|
||||
# #endif
|
||||
#
|
||||
# - an #elif/#else block ends on a different indent level than
|
||||
# the corresponding #ifdef block. Example:
|
||||
#
|
||||
# #ifdef TEST
|
||||
# int i;
|
||||
# #else
|
||||
# }
|
||||
# int j;
|
||||
# #endif
|
||||
pp_warn_unbalanced_if = false # true/false
|
||||
|
||||
#
|
||||
# Sort includes options
|
||||
|
|
@ -3251,17 +3464,16 @@ use_indent_func_call_param = true # true/false
|
|||
#
|
||||
# true: indent_continue will be used only once
|
||||
# false: indent_continue will be used every time (default)
|
||||
#
|
||||
# Requires indent_ignore_first_continue=false.
|
||||
use_indent_continue_only_once = false # true/false
|
||||
|
||||
# The value might be used twice:
|
||||
# - at the assignment
|
||||
# - at the opening brace
|
||||
# The indentation can be:
|
||||
# - after the assignment, at the '[' character
|
||||
# - at the beginning of the lambda body
|
||||
#
|
||||
# To prevent the double use of the indentation value, use this option with the
|
||||
# value 'true'.
|
||||
#
|
||||
# true: indentation will be used only once
|
||||
# false: indentation will be used every time (default)
|
||||
# true: indentation will be at the beginning of the lambda body
|
||||
# false: indentation will be after the assignment (default)
|
||||
indent_cpp_lambda_only_once = false # true/false
|
||||
|
||||
# Whether sp_after_angle takes precedence over sp_inside_fparen. This was the
|
||||
|
|
@ -3313,6 +3525,18 @@ debug_timeout = 0 # number
|
|||
# 0: do not truncate.
|
||||
debug_truncate = 0 # unsigned number
|
||||
|
||||
# sort (or not) the tracking info.
|
||||
#
|
||||
# Default: true
|
||||
debug_sort_the_tracks = true # true/false
|
||||
|
||||
# decode (or not) the flags as a new line.
|
||||
# only if the -p option is set.
|
||||
debug_decode_the_flags = false # true/false
|
||||
|
||||
# insert the number of the line at the beginning of each line
|
||||
set_numbering_for_html_output = false # true/false
|
||||
|
||||
# Meaning of the settings:
|
||||
# Ignore - do not do any changes
|
||||
# Add - makes sure there is 1 or more space/brace/newline/etc
|
||||
|
|
@ -3365,8 +3589,11 @@ debug_truncate = 0 # unsigned number
|
|||
# `macro-close END_MESSAGE_MAP`
|
||||
#
|
||||
#
|
||||
# option(s) with 'not default' value: 0
|
||||
#
|
||||
|
||||
type QWindow
|
||||
type QQuickItem
|
||||
#type QQuickItem
|
||||
#type QWindow
|
||||
#type QObject
|
||||
type int QT_VERSION_CHECK
|
||||
|
||||
# option(s) with 'not default' value: 116
|
||||
#
|
||||
|
|
|
|||
|
|
@ -418,7 +418,8 @@ static void addColoredBorderRectangles1( QskLinearBox* parent,
|
|||
box->setShape( 30, Qt::AbsoluteSize );
|
||||
}
|
||||
|
||||
static void addColoredBorderRectangles2( QskLinearBox* parent, bool rounded, Box::FillType fillType )
|
||||
static void addColoredBorderRectangles2( QskLinearBox* parent,
|
||||
bool rounded, Box::FillType fillType )
|
||||
{
|
||||
Box* box = new Box( parent );
|
||||
box->setBorderWidth( 20 );
|
||||
|
|
@ -431,7 +432,8 @@ static void addColoredBorderRectangles2( QskLinearBox* parent, bool rounded, Box
|
|||
box->setShape( 30, Qt::AbsoluteSize );
|
||||
}
|
||||
|
||||
static void addColoredBorderRectangles3( QskLinearBox* parent, bool rounded, Box::FillType fillType )
|
||||
static void addColoredBorderRectangles3( QskLinearBox* parent,
|
||||
bool rounded, Box::FillType fillType )
|
||||
{
|
||||
Box* box = new Box( parent );
|
||||
box->setBorderWidth( 20 );
|
||||
|
|
@ -471,7 +473,8 @@ static void addColoredBorderRectangles3( QskLinearBox* parent, bool rounded, Box
|
|||
box->setShape( 30, Qt::AbsoluteSize );
|
||||
}
|
||||
|
||||
static void addColoredBorderRectangles4( QskLinearBox* parent, bool rounded, Box::FillType fillType )
|
||||
static void addColoredBorderRectangles4( QskLinearBox* parent,
|
||||
bool rounded, Box::FillType fillType )
|
||||
{
|
||||
Box* box = new Box( parent );
|
||||
box->setBorderWidth( 20 );
|
||||
|
|
@ -485,7 +488,8 @@ static void addColoredBorderRectangles4( QskLinearBox* parent, bool rounded, Box
|
|||
box->setShape( 30, Qt::AbsoluteSize );
|
||||
}
|
||||
|
||||
static void addColoredBorderRectangles5( QskLinearBox* parent, bool rounded, Box::FillType fillType )
|
||||
static void addColoredBorderRectangles5( QskLinearBox* parent,
|
||||
bool rounded, Box::FillType fillType )
|
||||
{
|
||||
Box* box = new Box( parent );
|
||||
box->setBorderWidth( 20 );
|
||||
|
|
|
|||
|
|
@ -41,7 +41,8 @@ namespace
|
|||
};
|
||||
}
|
||||
|
||||
BoxWithButtons::BoxWithButtons( const QString& title, const QString &prefix,
|
||||
BoxWithButtons::BoxWithButtons(
|
||||
const QString& title, const QString& prefix,
|
||||
const int initialValue, const QString& suffix,
|
||||
bool isBright, QQuickItem* parent )
|
||||
: Box( QString(), parent )
|
||||
|
|
|
|||
|
|
@ -14,7 +14,8 @@ class BoxWithButtons : public Box
|
|||
public:
|
||||
QSK_SUBCONTROLS( Panel, ValuePanel, ValueText )
|
||||
|
||||
BoxWithButtons( const QString& title, const QString& prefix,
|
||||
BoxWithButtons(
|
||||
const QString& title, const QString& prefix,
|
||||
const int initialValue, const QString& suffix,
|
||||
bool isBright, QQuickItem* parent = nullptr );
|
||||
|
||||
|
|
|
|||
|
|
@ -146,7 +146,8 @@ QSGNode* DiagramSkinlet::updateChartNode( const Diagram* diagram, QSGNode* node
|
|||
|
||||
if( barsNode->childCount() > k )
|
||||
{
|
||||
barNode = static_cast< QskBoxRectangleNode* >( barsNode->childAtIndex( k ) );
|
||||
barNode = static_cast< QskBoxRectangleNode* >(
|
||||
barsNode->childAtIndex( k ) );
|
||||
}
|
||||
else
|
||||
{
|
||||
|
|
@ -181,7 +182,8 @@ QSGNode* DiagramSkinlet::updateChartNode( const Diagram* diagram, QSGNode* node
|
|||
|
||||
if( chartNode->childCount() > nodeIndex )
|
||||
{
|
||||
dataPointNode = static_cast< DiagramDataNode* >( chartNode->childAtIndex( nodeIndex ) );
|
||||
dataPointNode = static_cast< DiagramDataNode* >(
|
||||
chartNode->childAtIndex( nodeIndex ) );
|
||||
}
|
||||
else
|
||||
{
|
||||
|
|
@ -202,7 +204,8 @@ QSGNode* DiagramSkinlet::updateChartNode( const Diagram* diagram, QSGNode* node
|
|||
color = diagram->color( areaSubcontrol );
|
||||
}
|
||||
|
||||
dataPointNode->update( rect, nodeType, color, dataPoints, yMax, false, lineWidth );
|
||||
dataPointNode->update( rect, nodeType, color,
|
||||
dataPoints, yMax, false, lineWidth );
|
||||
}
|
||||
nodeIndex++;
|
||||
}
|
||||
|
|
|
|||
|
|
@ -22,7 +22,8 @@ QSK_SUBCONTROL( LightDisplay, Knob )
|
|||
|
||||
QSK_STATE( LightDisplay, Pressed, ( QskAspect::FirstUserState << 1 ) )
|
||||
|
||||
namespace {
|
||||
namespace
|
||||
{
|
||||
bool angleInRange( const QskArcMetrics& metrics, qreal angle )
|
||||
{
|
||||
return angle >= metrics.startAngle() && angle <= metrics.endAngle();
|
||||
|
|
|
|||
|
|
@ -39,7 +39,8 @@ QRectF LightDisplaySkinlet::subControlRect( const QskSkinnable* skinnable,
|
|||
{
|
||||
const auto textSize = textLabelsSize( display );
|
||||
const auto arcMetrics = display->arcMetricsHint( LightDisplay::ColdAndWarmArc );
|
||||
const qreal ticksWidth = display->arcMetricsHint( LightDisplay::Tickmarks ).width() + ticksSpacing;
|
||||
const qreal ticksWidth = display->arcMetricsHint(
|
||||
LightDisplay::Tickmarks ).width() + ticksSpacing;
|
||||
|
||||
const qreal x = textSize.width() + arcMetrics.width() + ticksWidth;
|
||||
const qreal w = contentsRect.width() -
|
||||
|
|
@ -104,7 +105,8 @@ QRectF LightDisplaySkinlet::subControlRect( const QskSkinnable* skinnable,
|
|||
}
|
||||
else if( subControl == LightDisplay::Knob )
|
||||
{
|
||||
const auto arcRect = subControlRect( skinnable, contentsRect, LightDisplay::ColdAndWarmArc );
|
||||
const auto arcRect = subControlRect( skinnable,
|
||||
contentsRect, LightDisplay::ColdAndWarmArc );
|
||||
const auto arcMetrics = display->arcMetricsHint( LightDisplay::ColdAndWarmArc );
|
||||
const auto knobSize = display->strutSizeHint( LightDisplay::Knob );
|
||||
|
||||
|
|
@ -166,18 +168,17 @@ QSGNode* LightDisplaySkinlet::updateSubNode(
|
|||
{
|
||||
const QString valueText = QString::number( display->value(), 'f', 0 )
|
||||
+ QStringLiteral( " %" );
|
||||
return updateTextNode( skinnable, node, valueText,
|
||||
LightDisplay::ValueText );
|
||||
return updateTextNode( skinnable, node, valueText, LightDisplay::ValueText );
|
||||
}
|
||||
case LeftLabelRole:
|
||||
{
|
||||
return updateTextNode( skinnable, node, QStringLiteral( "0 " ),
|
||||
LightDisplay::LeftLabel );
|
||||
return updateTextNode( skinnable, node,
|
||||
QStringLiteral( "0 " ), LightDisplay::LeftLabel );
|
||||
}
|
||||
case RightLabelRole:
|
||||
{
|
||||
return updateTextNode( skinnable, node, QStringLiteral( " 100" ),
|
||||
LightDisplay::RightLabel );
|
||||
return updateTextNode( skinnable, node,
|
||||
QStringLiteral( " 100" ), LightDisplay::RightLabel );
|
||||
}
|
||||
case KnobRole:
|
||||
{
|
||||
|
|
|
|||
|
|
@ -202,15 +202,19 @@ void Cube::keyPressEvent( QKeyEvent* event )
|
|||
case Qt::Key_Up:
|
||||
direction = Qsk::TopToBottom;
|
||||
break;
|
||||
|
||||
case Qt::Key_Down:
|
||||
direction = Qsk::BottomToTop;
|
||||
break;
|
||||
|
||||
case Qt::Key_Left:
|
||||
direction = Qsk::LeftToRight;
|
||||
break;
|
||||
|
||||
case Qt::Key_Right:
|
||||
direction = Qsk::RightToLeft;
|
||||
break;
|
||||
|
||||
default:
|
||||
return;
|
||||
}
|
||||
|
|
|
|||
|
|
@ -15,7 +15,8 @@ class Cube : public QskStackBox
|
|||
Q_OBJECT
|
||||
|
||||
public:
|
||||
enum Edge {
|
||||
enum Edge
|
||||
{
|
||||
LeftEdge = Qsk::LeftToRight,
|
||||
RightEdge = Qsk::RightToLeft,
|
||||
TopEdge = Qsk::TopToBottom,
|
||||
|
|
@ -24,7 +25,8 @@ class Cube : public QskStackBox
|
|||
};
|
||||
Q_ENUM( Edge )
|
||||
|
||||
enum Position {
|
||||
enum Position
|
||||
{
|
||||
LeftPos = LeftEdge,
|
||||
RightPos = RightEdge,
|
||||
TopPos = TopEdge,
|
||||
|
|
|
|||
|
|
@ -73,7 +73,8 @@ RoomsPage::RoomsPage( QQuickItem* parent )
|
|||
const QVector< qreal > livingRoomWater = { 5, 8, 13, 2, 3, 9, 11 };
|
||||
const QVector< qreal > livingRoomElectricity = { 1, 8, 7, 4, 12, 6, 5 };
|
||||
const QVector< qreal > livingRoomGas = { 10, 11, 5, 8, 3, 1, 7 };
|
||||
auto livingRoomDiagram = new RoomsDiagram( livingRoomWater, livingRoomElectricity, livingRoomGas );
|
||||
auto livingRoomDiagram = new RoomsDiagram(
|
||||
livingRoomWater, livingRoomElectricity, livingRoomGas );
|
||||
gridBox->addItem( new UsageDiagramBox( "Living Room", livingRoomDiagram ), 0, 0 );
|
||||
|
||||
const QVector< qreal > bedroomWater = { 8, 6, 11, 2, 5, 4, 9 };
|
||||
|
|
|
|||
|
|
@ -15,7 +15,8 @@ class RoundedIcon : public QskPushButton
|
|||
QSK_SUBCONTROLS( Panel, PalePanel, Graphic )
|
||||
QSK_STATES( Bright ) // to differentiate between orange and purple
|
||||
|
||||
enum {
|
||||
enum
|
||||
{
|
||||
NormalRole,
|
||||
CheckedRole,
|
||||
} GraphicRole;
|
||||
|
|
|
|||
|
|
@ -288,9 +288,9 @@ void Skin::initHints( const Palette& palette )
|
|||
|
||||
// storage bar
|
||||
{
|
||||
const auto make_gradient = []( const QColor color ) -> QskGradient {
|
||||
return { color.lighter(), color };
|
||||
};
|
||||
const auto make_gradient = []( const QColor color ) -> QskGradient
|
||||
{ return { color.lighter(), color }; };
|
||||
|
||||
ed.setGradient( StorageBar::Pictures, make_gradient( "#FFBE0B" ) );
|
||||
ed.setGradient( StorageBar::Music, make_gradient( "#FB5607" ) );
|
||||
ed.setGradient( StorageBar::Videos, make_gradient( "#FF006E" ) );
|
||||
|
|
|
|||
|
|
@ -43,9 +43,9 @@ class StorageBar final : public QskControl
|
|||
void othersChanged( qreal value );
|
||||
|
||||
private:
|
||||
qreal m_pictures{ 0.0 };
|
||||
qreal m_music{ 0.0 };
|
||||
qreal m_videos{ 0.0 };
|
||||
qreal m_documents{ 0.0 };
|
||||
qreal m_others{ 0.0 };
|
||||
qreal m_pictures = 0.0;
|
||||
qreal m_music = 0.0;
|
||||
qreal m_videos = 0.0;
|
||||
qreal m_documents = 0.0;
|
||||
qreal m_others = 0.0;
|
||||
};
|
||||
|
|
|
|||
|
|
@ -140,7 +140,8 @@ void UsageDiagram::addCurve( const qreal values[], const size_t count )
|
|||
addDataPoints( points, Diagram::Area );
|
||||
}
|
||||
|
||||
UsageDiagramBox::UsageDiagramBox(const QString &title, Diagram *diagram, QQuickItem* parent )
|
||||
UsageDiagramBox::UsageDiagramBox(
|
||||
const QString& title, Diagram* diagram, QQuickItem* parent )
|
||||
: Box( title, parent )
|
||||
{
|
||||
diagram->setParent( this );
|
||||
|
|
|
|||
|
|
@ -75,7 +75,8 @@ void GridQuick::insert( const QByteArray& colorName,
|
|||
We need to create a temporary layout in QML, so that the
|
||||
object for the attachedProperties is created early
|
||||
*/
|
||||
auto layout = createQml( "import QtQuick 2.0\nimport QtQuick.Layouts 1.15\nGridLayout { Rectangle {} }" );
|
||||
auto layout = createQml(
|
||||
"import QtQuick 2.0\nimport QtQuick.Layouts 1.15\nGridLayout { Rectangle {} }" );
|
||||
|
||||
auto rectangle = layout->childItems().constFirst();
|
||||
rectangle->setParent( nullptr );
|
||||
|
|
|
|||
|
|
@ -130,8 +130,7 @@ Qt::ShortcutContext QskShortcutQml::context() const
|
|||
|
||||
void QskShortcutQml::setContext( Qt::ShortcutContext context )
|
||||
{
|
||||
if ( context == Qt::ApplicationShortcut ||
|
||||
context == Qt::WindowShortcut )
|
||||
if ( context == Qt::ApplicationShortcut || context == Qt::WindowShortcut )
|
||||
{
|
||||
const bool isWindowContext = ( context == Qt::WindowShortcut );
|
||||
|
||||
|
|
|
|||
|
|
@ -680,13 +680,16 @@ void Editor::setupPushButton()
|
|||
setGradient( Q::Panel | M3::Elevated | Q::Disabled, m_pal.onSurface12 );
|
||||
setShadowMetrics( Q::Panel | M3::Elevated | Q::Disabled, m_pal.elevation0 );
|
||||
setColor( Q::Text | M3::Elevated | Q::Disabled, m_pal.onSurface38 );
|
||||
setGraphicRole( Q::Graphic | M3::Elevated | Q::Disabled, QskMaterial3Skin::GraphicRoleOnSurface38 );
|
||||
setGraphicRole( Q::Graphic | M3::Elevated | Q::Disabled,
|
||||
QskMaterial3Skin::GraphicRoleOnSurface38 );
|
||||
|
||||
const auto elevatedHoverColor = flattenedColor( m_pal.primary, m_pal.surface, m_pal.hoverOpacity );
|
||||
const auto elevatedHoverColor =
|
||||
flattenedColor( m_pal.primary, m_pal.surface, m_pal.hoverOpacity );
|
||||
setGradient( Q::Panel | M3::Elevated | Q::Hovered, elevatedHoverColor );
|
||||
setShadowMetrics( Q::Panel | M3::Elevated | Q::Hovered, m_pal.elevation2 );
|
||||
|
||||
const auto elevatedPressedColor = flattenedColor( m_pal.primary, m_pal.surface, m_pal.pressedOpacity );
|
||||
const auto elevatedPressedColor =
|
||||
flattenedColor( m_pal.primary, m_pal.surface, m_pal.pressedOpacity );
|
||||
setGradient( Q::Panel | M3::Elevated | Q::Focused, elevatedPressedColor );
|
||||
setShadowMetrics( Q::Panel | M3::Elevated | Q::Focused, m_pal.elevation1 );
|
||||
|
||||
|
|
@ -724,17 +727,21 @@ void Editor::setupPushButton()
|
|||
setShadowMetrics( Q::Panel | M3::Tonal, m_pal.elevation0 );
|
||||
setColor( Q::Text | M3::Tonal, m_pal.onSecondaryContainer );
|
||||
setGraphicRole( Q::Graphic | M3::Tonal, QskMaterial3Skin::GraphicRoleOnSecondaryContainer );
|
||||
setGradient( Q::Ripple | M3::Tonal, stateLayerColor( m_pal.onSecondaryContainer, m_pal.pressedOpacity ) );
|
||||
setGradient( Q::Ripple | M3::Tonal,
|
||||
stateLayerColor( m_pal.onSecondaryContainer, m_pal.pressedOpacity ) );
|
||||
|
||||
setGradient( Q::Panel | M3::Tonal | Q::Disabled, m_pal.onSurface12 );
|
||||
setColor( Q::Text | M3::Tonal | Q::Disabled, m_pal.onSurface38 );
|
||||
setGraphicRole( Q::Graphic | M3::Tonal | Q::Disabled, QskMaterial3Skin::GraphicRoleOnSurface38 );
|
||||
setGraphicRole( Q::Graphic | M3::Tonal | Q::Disabled,
|
||||
QskMaterial3Skin::GraphicRoleOnSurface38 );
|
||||
|
||||
const auto tonalHoverColor = flattenedColor( m_pal.onSecondaryContainer, m_pal.secondaryContainer, m_pal.hoverOpacity );
|
||||
const auto tonalHoverColor = flattenedColor( m_pal.onSecondaryContainer,
|
||||
m_pal.secondaryContainer, m_pal.hoverOpacity );
|
||||
setGradient( Q::Panel | M3::Tonal | Q::Hovered, tonalHoverColor );
|
||||
setShadowMetrics( Q::Panel | M3::Tonal | Q::Hovered, m_pal.elevation1 );
|
||||
|
||||
const auto tonalPressedColor = flattenedColor( m_pal.onSecondaryContainer, m_pal.secondaryContainer, m_pal.pressedOpacity );
|
||||
const auto tonalPressedColor = flattenedColor( m_pal.onSecondaryContainer,
|
||||
m_pal.secondaryContainer, m_pal.pressedOpacity );
|
||||
setGradient( Q::Panel | M3::Tonal | Q::Focused, tonalPressedColor );
|
||||
setShadowMetrics( Q::Panel | M3::Tonal | Q::Focused, m_pal.elevation0 );
|
||||
|
||||
|
|
@ -754,7 +761,8 @@ void Editor::setupPushButton()
|
|||
|
||||
setBoxBorderColors( Q::Panel | M3::Outlined | Q::Disabled, m_pal.onSurface12 );
|
||||
setColor( Q::Text | M3::Outlined | Q::Disabled, m_pal.onSurface38 );
|
||||
setGraphicRole( Q::Graphic | M3::Outlined | Q::Disabled, QskMaterial3Skin::GraphicRoleOnSurface38 );
|
||||
setGraphicRole( Q::Graphic | M3::Outlined | Q::Disabled,
|
||||
QskMaterial3Skin::GraphicRoleOnSurface38 );
|
||||
|
||||
setBoxBorderColors( Q::Panel | M3::Outlined | Q::Hovered, m_pal.outline );
|
||||
setGradient( Q::Panel | M3::Outlined | Q::Hovered, m_pal.primary8 );
|
||||
|
|
|
|||
|
|
@ -38,11 +38,8 @@ QVariant QskTextColors::interpolate(
|
|||
|
||||
static inline void qskDebugColor( QDebug debug, const QColor& c )
|
||||
{
|
||||
debug << '('
|
||||
<< c.red() << ','
|
||||
<< c.green() << ','
|
||||
<< c.blue() << ','
|
||||
<< c.alpha() << ')';
|
||||
debug << '(' << c.red() << ',' << c.green() << ','
|
||||
<< c.blue() << ',' << c.alpha() << ')';
|
||||
}
|
||||
|
||||
QDebug operator<<( QDebug debug, const QskTextColors& colors )
|
||||
|
|
|
|||
|
|
@ -55,11 +55,8 @@ QskComboBox::QskComboBox( QQuickItem* parent )
|
|||
connect( this, &QskComboBox::currentIndexChanged,
|
||||
this, &QskControl::focusIndicatorRectChanged );
|
||||
|
||||
connect( m_data->menu, &QskMenu::closed, this, [ this ]()
|
||||
{
|
||||
setPopupOpen( false );
|
||||
setFocus( true );
|
||||
} );
|
||||
connect( m_data->menu, &QskMenu::closed, this,
|
||||
[ this ]() { setPopupOpen( false ); setFocus( true ); } );
|
||||
|
||||
connect( this, &QskComboBox::pressed, this, &QskComboBox::togglePopup );
|
||||
}
|
||||
|
|
|
|||
|
|
@ -52,7 +52,8 @@ QskControl::~QskControl()
|
|||
if( this == w->mouseGrabberItem() )
|
||||
{
|
||||
// to catch suicide situations as a result of mouse clicks
|
||||
qWarning() << "QskControl::~QskControl: probably suicide situation detected, control is the mouse grabber item" << this;
|
||||
qWarning() << "QskControl::~QskControl: probably suicide situation detected, "
|
||||
"control is the mouse grabber item" << this;
|
||||
}
|
||||
|
||||
}
|
||||
|
|
|
|||
|
|
@ -26,7 +26,7 @@ class QKeyEvent;
|
|||
#define QSK_EVENT_DISABLE_COPY( Class ) \
|
||||
Class( const Class& ) = default; \
|
||||
Class( Class && ) = delete; \
|
||||
Class &operator=(const Class &other) = default; \
|
||||
Class& operator=( const Class & ) = default; \
|
||||
Class& operator=( Class && ) = delete;
|
||||
|
||||
class QSK_EXPORT QskEvent : public QEvent
|
||||
|
|
|
|||
|
|
@ -37,9 +37,7 @@ QskRadioBox::QskRadioBox( QQuickItem* parent )
|
|||
|
||||
connect(this, &QskRadioBox::itemsChanged, this,
|
||||
[this]( const QStringList& items )
|
||||
{
|
||||
setFocusPolicy( items.count() > 0 ? Qt::StrongFocus : Qt::NoFocus );
|
||||
}
|
||||
{ setFocusPolicy( items.count() > 0 ? Qt::StrongFocus : Qt::NoFocus ); }
|
||||
);
|
||||
|
||||
setFocusedIndex( -1 );
|
||||
|
|
|
|||
|
|
@ -59,16 +59,18 @@ namespace
|
|||
LayoutEngine( const QskSegmentedBar* bar, int index )
|
||||
: QskSubcontrolLayoutEngine( bar->orientation() )
|
||||
{
|
||||
setSpacing( bar->spacingHint( QskSegmentedBar::Panel ) );
|
||||
using Q = QskSegmentedBar;
|
||||
|
||||
setSpacing( bar->spacingHint( Q::Panel ) );
|
||||
|
||||
setGraphicTextElements( bar,
|
||||
QskSegmentedBar::Text, qskValueAt< QString >( bar, index ),
|
||||
QskSegmentedBar::Graphic, graphicAt( bar, index ).defaultSize() );
|
||||
Q::Text, qskValueAt< QString >( bar, index ),
|
||||
Q::Graphic, graphicAt( bar, index ).defaultSize() );
|
||||
|
||||
if( bar->orientation() == Qt::Horizontal )
|
||||
{
|
||||
const auto alignment = bar->alignmentHint( QskSegmentedBar::Panel, Qt::AlignCenter );
|
||||
setFixedContent( QskSegmentedBar::Text, Qt::Horizontal, alignment );
|
||||
const auto alignment = bar->alignmentHint( Q::Panel, Qt::AlignCenter );
|
||||
setFixedContent( Q::Text, Qt::Horizontal, alignment );
|
||||
}
|
||||
}
|
||||
};
|
||||
|
|
@ -218,7 +220,8 @@ QSGNode* QskSegmentedBarSkinlet::updateSubNode(
|
|||
return nullptr;
|
||||
}
|
||||
|
||||
QSizeF QskSegmentedBarSkinlet::segmentSizeHint( const QskSegmentedBar* bar, Qt::SizeHint which ) const
|
||||
QSizeF QskSegmentedBarSkinlet::segmentSizeHint(
|
||||
const QskSegmentedBar* bar, Qt::SizeHint which ) const
|
||||
{
|
||||
using Q = QskSegmentedBar;
|
||||
|
||||
|
|
@ -228,13 +231,14 @@ QSizeF QskSegmentedBarSkinlet::segmentSizeHint( const QskSegmentedBar* bar, Qt::
|
|||
{
|
||||
LayoutEngine layoutEngine( bar, i );
|
||||
|
||||
const auto graphic = bar->effectiveSkin()->symbol( QskStandardSymbol::SegmentedBarCheckMark );
|
||||
const auto graphic = bar->effectiveSkin()->symbol(
|
||||
QskStandardSymbol::SegmentedBarCheckMark );
|
||||
|
||||
// We want to know how big the element can grow when it is selected,
|
||||
// i.e. when it has the checkmark symbol:
|
||||
layoutEngine.setGraphicTextElements( bar,
|
||||
QskSegmentedBar::Text, qskValueAt< QString >( bar, i ),
|
||||
QskSegmentedBar::Graphic, graphic.defaultSize() );
|
||||
Q::Text, qskValueAt< QString >( bar, i ),
|
||||
Q::Graphic, graphic.defaultSize() );
|
||||
|
||||
const auto size = layoutEngine.sizeHint( which, QSizeF() );
|
||||
|
||||
|
|
|
|||
|
|
@ -49,8 +49,8 @@ class QSK_EXPORT QskSpinBox : public QskBoundedValueInput
|
|||
Q_ENUM( Decoration )
|
||||
|
||||
QskSpinBox( QQuickItem* parent = nullptr );
|
||||
QskSpinBox( qreal min, qreal max, qreal stepSize,
|
||||
QQuickItem* parent = nullptr );
|
||||
QskSpinBox( qreal min, qreal max,
|
||||
qreal stepSize, QQuickItem* parent = nullptr );
|
||||
|
||||
~QskSpinBox() override;
|
||||
|
||||
|
|
|
|||
|
|
@ -408,7 +408,8 @@ void QskSubcontrolLayoutEngine::setGraphicTextElements( const QskSkinnable* skin
|
|||
}
|
||||
}
|
||||
|
||||
void QskSubcontrolLayoutEngine::setFixedContent( QskAspect::Subcontrol subcontrol, Qt::Orientation orientation, Qt::Alignment alignment )
|
||||
void QskSubcontrolLayoutEngine::setFixedContent(
|
||||
QskAspect::Subcontrol subcontrol, Qt::Orientation orientation, Qt::Alignment alignment )
|
||||
{
|
||||
if( auto* e = element( subcontrol ) )
|
||||
{
|
||||
|
|
|
|||
Loading…
Reference in New Issue