diff options
author | Matthias Clasen <mclasen@redhat.com> | 2020-11-17 21:52:15 -0500 |
---|---|---|
committer | Matthias Clasen <mclasen@redhat.com> | 2020-11-17 21:52:15 -0500 |
commit | de461712a1e5ae5ba2790ed855bbaf784056330e (patch) | |
tree | 9b9e489c6c05088488633966609e49586a7e90e0 | |
parent | 9128ad105b1b2644e6cf404e3757bdcf424fc859 (diff) | |
download | gtk+-de461712a1e5ae5ba2790ed855bbaf784056330e.tar.gz |
constraint-editor: Improve display of constraints
No need to go for ALGOL60 style operators when we
have Unicode.
-rw-r--r-- | demos/constraint-editor/constraint-editor.c | 18 |
1 files changed, 17 insertions, 1 deletions
diff --git a/demos/constraint-editor/constraint-editor.c b/demos/constraint-editor/constraint-editor.c index 62af6e356f..ffbc6a15b0 100644 --- a/demos/constraint-editor/constraint-editor.c +++ b/demos/constraint-editor/constraint-editor.c @@ -212,6 +212,22 @@ get_relation_nick (GtkConstraintRelation relation) return nick; } +static const char * +get_relation_display_name (GtkConstraintRelation relation) +{ + switch (relation) + { + case GTK_CONSTRAINT_RELATION_LE: + return "≤"; + case GTK_CONSTRAINT_RELATION_EQ: + return "="; + case GTK_CONSTRAINT_RELATION_GE: + return "≥"; + default: + return "?"; + } +} + static GtkConstraintStrength get_strength (const char *id) { @@ -347,7 +363,7 @@ constraint_editor_constraint_to_string (GtkConstraint *constraint) name = get_target_name (gtk_constraint_get_target (constraint)); attr = get_attr_nick (gtk_constraint_get_target_attribute (constraint)); - relation = get_relation_nick (gtk_constraint_get_relation (constraint)); + relation = get_relation_display_name (gtk_constraint_get_relation (constraint)); if (name == NULL) name = "[ ]"; |