app: derive the layer-mode menu layout entirely from the info arrays

Replace the 'with-behind' and 'with-replace' properties with a
single 'context' property, and use it to select the included
layer modes, according to their context mask.

Add a dummy GIMP_LAYER_MODE_SEPARATOR value to the GimpLayerMode
enum, and use it to explicitly mark the menu separators in the
layer-mode group arrays; add separators to the layer-mode menu
accordingly.

Update the rest of the code to use 'context' instead of 'with-behind'
and 'with-replace'.  In particular, in the layers and layer options
dialogs, select the right context based on whether or not the
selected layer is a group.
This commit is contained in:
Ell
2017-02-17 05:20:53 -05:00
parent c3d2f57e28
commit e30d235ede
13 changed files with 281 additions and 368 deletions

View File

@ -46,18 +46,21 @@ struct _GimpLayerModeComboBoxClass
};
GType gimp_layer_mode_combo_box_get_type (void) G_GNUC_CONST;
GType gimp_layer_mode_combo_box_get_type (void) G_GNUC_CONST;
GtkWidget * gimp_layer_mode_combo_box_new (gboolean with_behind,
gboolean with_replace);
GtkWidget * gimp_layer_mode_combo_box_new (GimpLayerModeContext context);
void gimp_layer_mode_combo_box_set_mode (GimpLayerModeComboBox *combo,
GimpLayerMode mode);
GimpLayerMode gimp_layer_mode_combo_box_get_mode (GimpLayerModeComboBox *combo);
void gimp_layer_mode_combo_box_set_context (GimpLayerModeComboBox *combo,
GimpLayerModeContext context);
GimpLayerModeContext gimp_layer_mode_combo_box_get_context (GimpLayerModeComboBox *combo);
void gimp_layer_mode_combo_box_set_group (GimpLayerModeComboBox *combo,
GimpLayerModeGroup group);
GimpLayerModeGroup gimp_layer_mode_combo_box_get_group (GimpLayerModeComboBox *combo);
void gimp_layer_mode_combo_box_set_mode (GimpLayerModeComboBox *combo,
GimpLayerMode mode);
GimpLayerMode gimp_layer_mode_combo_box_get_mode (GimpLayerModeComboBox *combo);
void gimp_layer_mode_combo_box_set_group (GimpLayerModeComboBox *combo,
GimpLayerModeGroup group);
GimpLayerModeGroup gimp_layer_mode_combo_box_get_group (GimpLayerModeComboBox *combo);
#endif /* __GIMP_LAYER_MODE_COMBO_BOX_H__ */