Skip to content

Commit

Permalink
formatting
Browse files Browse the repository at this point in the history
  • Loading branch information
halfmexican committed Sep 15, 2024
1 parent 22ee9f4 commit 17612dc
Show file tree
Hide file tree
Showing 2 changed files with 16 additions and 19 deletions.
12 changes: 6 additions & 6 deletions src/emoji_data_manager.vala
Original file line number Diff line number Diff line change
Expand Up @@ -183,17 +183,17 @@ namespace Mingle {
return combinations_map;
}

public EmojiData? get_emoji_data(string emoji_codepoint) {
if (!emoji_data_map.has_key(emoji_codepoint)) {
emoji_data_map[emoji_codepoint] = create_emoji_data(emoji_codepoint);
public EmojiData ? get_emoji_data (string emoji_codepoint) {
if (!emoji_data_map.has_key (emoji_codepoint)) {
emoji_data_map[emoji_codepoint] = create_emoji_data (emoji_codepoint);
}

EmojiData? emoji_data = emoji_data_map[emoji_codepoint];
if (emoji_data != null && emoji_data.combinations == null) {
Json.Object data_object = root_object.get_object_member("data");
Json.Object? emoji_object = data_object.get_object_member(emoji_codepoint);
Json.Object data_object = root_object.get_object_member ("data");
Json.Object? emoji_object = data_object.get_object_member (emoji_codepoint);
if (emoji_object != null) {
emoji_data.combinations = populate_combinations(emoji_object.get_object_member("combinations"));
emoji_data.combinations = populate_combinations (emoji_object.get_object_member ("combinations"));
}
}

Expand Down
23 changes: 10 additions & 13 deletions src/window.vala
Original file line number Diff line number Diff line change
Expand Up @@ -165,7 +165,7 @@ namespace Mingle {
combined_emoji.copied.connect (() => {
create_and_show_toast ("Image copied to clipboard", 2);
});
emoji_manager.add_combination(combination_key);
emoji_manager.add_combination (combination_key);
} else {
warning ("Invalid Combination\n %s", new_emoji_combination.gstatic_url);
combined_emoji.destroy ();
Expand All @@ -177,7 +177,7 @@ namespace Mingle {

private async void append_combined_emoji (string left_emoji_code, string right_emoji_code, Gtk.RevealerTransitionType transition) {
string combination_key = left_emoji_code + right_emoji_code;
if (emoji_manager.is_combination_added(combination_key)) {
if (emoji_manager.is_combination_added (combination_key)) {
return;
}

Expand All @@ -191,7 +191,7 @@ namespace Mingle {
create_and_show_toast ("Image copied to clipboard", 2);
});
combined_emoji.reveal ();
emoji_manager.add_combination(combination_key);
emoji_manager.add_combination (combination_key);
} else {
warning ("Invalid Combination\n %s", new_emoji_combination.gstatic_url);
combined_emoji.destroy ();
Expand Down Expand Up @@ -277,8 +277,8 @@ namespace Mingle {
private Transition get_transition_type () {
uint transition = settings.get_int ("transition-type");
switch (transition) {
case 0: return Transition.NONE;
case 1: return Transition.CROSSFADE;
case 0 : return Transition.NONE;
case 1 : return Transition.CROSSFADE;
case 2: return Transition.SLIDE;
case 3: return Transition.SWING;
default: return Transition.NONE;
Expand Down Expand Up @@ -311,20 +311,20 @@ namespace Mingle {
private void set_child_sensitivity (Gtk.FlowBoxChild child) {
Mingle.EmojiLabel emoji_label = (Mingle.EmojiLabel) child.get_child ();
string right_emoji_code = emoji_label.codepoint;

// Check if the combination exists in the left emoji's combinations
bool combination_exists = left_emoji.combinations.has_key(right_emoji_code);
bool combination_exists = left_emoji.combinations.has_key (right_emoji_code);
child.set_sensitive (combination_exists);
}

private void update_sensitivity_of_right_flowbox () {
Gtk.FlowBoxChild child = right_emojis_flow_box.get_child_at_index (0);
int index = 0;

while (child != null) {
if (child is Gtk.Widget) {
set_child_sensitivity (child);

if (!child.get_sensitive ()) {
child.add_css_class ("invalid");
} else {
Expand All @@ -335,7 +335,6 @@ namespace Mingle {
child = right_emojis_flow_box.get_child_at_index (index);
}
}


private void update_window_title () {
string title = "Mingle: ";
Expand All @@ -351,8 +350,6 @@ namespace Mingle {
this.set_title (title);
}



// Toolbar Style
private void apply_toolbar_style () {
var style = get_toolbar_style ();
Expand Down

0 comments on commit 17612dc

Please sign in to comment.