Compare commits

...
8 Commits
9 changed files with 55 additions and 45 deletions
@@ -0,0 +1,13 @@
<?xml version="1.0" encoding="UTF-8"?>
<svg xmlns="http://www.w3.org/2000/svg" xmlns:xlink="http://www.w3.org/1999/xlink" width="44px" height="44px" viewBox="0 0 44 44" version="1.1">
<defs>
<style type="text/css" id="current-color-scheme">.ColorScheme-Text { color: #232629; }</style>
</defs>
<g id="surface1" class="ColorScheme-Text" transform="translate(0,13.5)">
<path style=" stroke:none;fill-rule:nonzero;fill:currentColor;" d="M 32.121094 9.878906 C 30.476562 9.601562 28.65625 7.699219 27.839844 5.402344 C 27.375 4.097656 27.199219 2.125 27.476562 1.324219 C 27.71875 0.613281 28.347656 0.382812 28.625 0.898438 C 28.664062 0.980469 28.726562 1.546875 28.757812 2.160156 C 28.863281 4.25 29.320312 5.632812 30.316406 6.867188 C 31.847656 8.761719 33.417969 8.796875 34.800781 6.960938 C 35.917969 5.488281 36.316406 3.945312 36.140625 1.792969 C 36.09375 1.238281 36.082031 0.695312 36.109375 0.585938 C 36.136719 0.476562 36.25 0.292969 36.363281 0.179688 C 36.539062 0.00390625 36.605469 -0.0195312 36.8125 0.0117188 C 36.949219 0.0351562 37.121094 0.109375 37.195312 0.175781 C 37.699219 0.628906 37.933594 2.480469 37.691406 4.105469 C 37.550781 5.050781 37.414062 5.523438 37.074219 6.265625 C 36.148438 8.273438 34.757812 9.589844 33.277344 9.855469 C 32.695312 9.960938 32.632812 9.960938 32.121094 9.878906 Z M 32.121094 9.878906 "/>
<path style=" stroke:none;fill-rule:nonzero;fill:currentColor;" d="M 11.191406 10.164062 C 10.328125 10.03125 9.667969 9.722656 8.886719 9.085938 C 7.757812 8.167969 6.8125 6.328125 6.570312 4.597656 C 6.425781 3.519531 6.550781 1.832031 6.855469 0.804688 C 6.996094 0.320312 7.445312 0.117188 7.730469 0.40625 C 7.894531 0.570312 7.90625 0.878906 7.789062 1.664062 C 7.621094 2.777344 7.941406 4.714844 8.472656 5.78125 C 9.394531 7.632812 10.773438 8.621094 12.078125 8.363281 C 12.765625 8.226562 13.1875 7.976562 13.824219 7.328125 C 14.292969 6.855469 14.464844 6.617188 14.691406 6.148438 C 15.226562 5.035156 15.476562 4.117188 15.667969 2.5625 C 15.777344 1.691406 16.128906 1.253906 16.644531 1.351562 C 16.875 1.398438 17.207031 1.753906 17.308594 2.058594 C 17.664062 3.136719 16.894531 6.117188 15.851562 7.703125 C 15.191406 8.707031 14.195312 9.535156 13.195312 9.914062 C 12.8125 10.058594 11.847656 10.25 11.613281 10.222656 C 11.566406 10.21875 11.378906 10.191406 11.191406 10.164062 Z M 11.191406 10.164062 "/>
<path style=" stroke:none;fill-rule:nonzero;fill:currentColor;" d="M 19.878906 13.800781 C 18.96875 13.511719 18.183594 12.445312 17.933594 11.152344 C 17.886719 10.914062 17.863281 10.417969 17.878906 10.03125 C 17.902344 9.417969 17.925781 9.316406 18.070312 9.160156 C 18.335938 8.875 18.683594 8.957031 18.816406 9.339844 C 18.859375 9.460938 18.894531 9.734375 18.894531 9.949219 C 18.894531 10.734375 19.28125 11.730469 19.785156 12.238281 C 20.285156 12.746094 20.589844 12.667969 21 11.921875 C 21.125 11.695312 21.332031 11.410156 21.460938 11.285156 C 21.667969 11.09375 21.746094 11.0625 22.058594 11.0625 L 22.414062 11.0625 L 22.941406 11.617188 C 23.265625 11.957031 23.523438 12.167969 23.609375 12.167969 C 23.820312 12.167969 24.222656 11.722656 24.445312 11.246094 C 24.644531 10.824219 24.722656 10.515625 24.84375 9.65625 C 24.925781 9.082031 25.042969 8.886719 25.359375 8.78125 C 25.664062 8.679688 25.910156 8.785156 26.132812 9.117188 C 26.332031 9.417969 26.339844 9.976562 26.15625 10.757812 C 25.925781 11.726562 25.574219 12.386719 24.980469 12.988281 C 24.523438 13.445312 24.21875 13.582031 23.652344 13.582031 C 23.101562 13.582031 22.773438 13.441406 22.390625 13.039062 C 22.261719 12.902344 22.121094 12.792969 22.082031 12.792969 C 22.042969 12.796875 21.929688 12.917969 21.828125 13.0625 C 21.359375 13.75 20.613281 14.03125 19.878906 13.800781 Z M 19.878906 13.800781 "/>
<path style=" stroke:none;fill-rule:nonzero;fill:currentColor;" d="M 37.90625 16.839844 C 36.679688 16.523438 35.683594 15.535156 35.230469 14.175781 C 35.0625 13.679688 35.035156 13.476562 35.03125 12.859375 C 35.027344 11.363281 35.585938 10.195312 36.738281 9.289062 C 37.253906 8.886719 37.722656 8.648438 38.621094 8.328125 C 40.253906 7.753906 41.417969 7.984375 42.605469 9.121094 C 43.261719 9.75 43.613281 10.308594 43.863281 11.113281 C 44.027344 11.636719 44.039062 11.761719 44.007812 12.53125 C 43.96875 13.5 43.851562 13.914062 43.394531 14.695312 C 42.800781 15.710938 41.867188 16.417969 40.703125 16.738281 C 39.980469 16.933594 38.492188 16.988281 37.90625 16.839844 Z M 37.90625 16.839844 "/>
<path style=" stroke:none;fill-rule:nonzero;fill:currentColor;" d="M 3.175781 16.914062 C 1.519531 16.53125 0.515625 15.589844 0.128906 14.066406 C -0.03125 13.4375 -0.0429688 12.929688 0.09375 12.292969 C 0.457031 10.5625 1.566406 9.246094 3.105469 8.730469 C 3.613281 8.558594 3.746094 8.542969 4.820312 8.539062 C 6.121094 8.535156 6.207031 8.558594 6.75 9.058594 C 6.90625 9.203125 7.167969 9.390625 7.332031 9.476562 C 7.773438 9.703125 8.566406 10.539062 8.816406 11.042969 C 9.597656 12.609375 9.28125 14.285156 7.941406 15.636719 C 6.988281 16.597656 6.125 16.941406 4.546875 16.984375 C 3.890625 17.003906 3.457031 16.980469 3.175781 16.914062 Z M 3.175781 16.914062 "/>
</g>
</svg>

After

Width:  |  Height:  |  Size: 5.1 KiB

+2 -7
View File
@@ -17,11 +17,6 @@ install_data(
)
install_data(
join_paths(scalable_dir, ('@0@-tray-dark.svg').format(application_id)),
install_dir: join_paths(get_option('datadir'), 'icons', scalable_dir)
)
install_data(
join_paths(scalable_dir, ('@0@-tray-light.svg').format(application_id)),
install_dir: join_paths(get_option('datadir'), 'icons', scalable_dir)
join_paths(symbolic_dir, ('@0@-tray-symbolic.svg').format(application_id)),
install_dir: join_paths(get_option('datadir'), 'icons', symbolic_dir)
)
Binary file not shown.

Before

Width:  |  Height:  |  Size: 321 KiB

After

Width:  |  Height:  |  Size: 475 KiB

+2 -2
View File
@@ -17,8 +17,8 @@
"sources": [
{
"type": "archive",
"url": "https://gitea.angeltech.jp/Angel-Technologies/MoeMoji/archive/v0.3.0.tar.gz",
"sha256": "276d4a985d47f1e0fc49a19601d83cdae926cd985c5aa4e43ccecda62e3a3e2d"
"url": "https://gitea.angeltech.jp/Angel-Technologies/MoeMoji/archive/v0.3.4.tar.gz",
"sha256": "6373ed77df202d467e5703a6bc28c753be4010fb62e6afa9b662b7eb853b0c9b"
}
]
}
BIN
View File
Binary file not shown.

Before

Width:  |  Height:  |  Size: 335 KiB

After

Width:  |  Height:  |  Size: 487 KiB

+2 -28
View File
@@ -245,12 +245,8 @@ GVariant *sni_get_property(G_GNUC_UNUSED GDBusConnection *connection,
return g_variant_new_string("MoeMoji");
if (g_strcmp0(property_name, "Status") == 0)
return g_variant_new_string("Active");
if (g_strcmp0(property_name, "IconName") == 0) {
MoeMojiApplication *self = MOEMOJI_APPLICATION(user_data);
return g_variant_new_string(self->tray_icon_name
? self->tray_icon_name
: "jp.angeltech.MoeMoji-tray-dark");
}
if (g_strcmp0(property_name, "IconName") == 0)
return g_variant_new_string("jp.angeltech.MoeMoji-tray-symbolic");
if (g_strcmp0(property_name, "ItemIsMenu") == 0)
return g_variant_new_boolean(FALSE);
if (g_strcmp0(property_name, "Menu") == 0)
@@ -269,25 +265,6 @@ static const GDBusInterfaceVTable sni_vtable = {
.set_property = NULL,
};
static void update_tray_icon(MoeMojiApplication *self) {
AdwStyleManager *sm = adw_style_manager_get_default();
gboolean dark = adw_style_manager_get_dark(sm);
self->tray_icon_name = dark ? "jp.angeltech.MoeMoji-tray-dark"
: "jp.angeltech.MoeMoji-tray-light";
if (self->dbus_conn && self->sni_registration_id > 0) {
g_dbus_connection_emit_signal(self->dbus_conn, NULL, "/StatusNotifierItem",
"org.kde.StatusNotifierItem", "NewIcon", NULL,
NULL);
}
}
static void on_dark_changed(G_GNUC_UNUSED GObject *obj,
G_GNUC_UNUSED GParamSpec *pspec,
gpointer user_data) {
update_tray_icon(MOEMOJI_APPLICATION(user_data));
}
static void setup_sni(MoeMojiApplication *self) {
GError *error = NULL;
self->dbus_conn = g_bus_get_sync(G_BUS_TYPE_SESSION, NULL, &error);
@@ -547,9 +524,6 @@ static void moemoji_application_startup(GApplication *app) {
}
}
setup_sni(self);
update_tray_icon(self);
g_signal_connect(adw_style_manager_get_default(), "notify::dark",
G_CALLBACK(on_dark_changed), self);
setup_global_shortcuts(self);
}
-1
View File
@@ -13,7 +13,6 @@ struct _MoeMojiApplication {
guint sni_registration_id;
guint menu_registration_id;
gchar *icon_theme_path;
const gchar *tray_icon_name;
GDBusProxy *shortcuts_proxy;
gchar *shortcuts_session_path;
gboolean has_tray;
+35 -6
View File
@@ -329,6 +329,7 @@ static void add_kaomoji_button(MoeMojiWindow *self, GtkFlowBox *flow,
GtkWidget *button = gtk_button_new_with_label(label_text);
gtk_widget_set_halign(button, GTK_ALIGN_FILL);
GtkWidget *label = gtk_button_get_child(GTK_BUTTON(button));
gtk_widget_add_css_class(label, "kaomoji-label");
gtk_label_set_ellipsize(GTK_LABEL(label), PANGO_ELLIPSIZE_END);
gtk_label_set_xalign(GTK_LABEL(label), 0.0);
gtk_widget_add_css_class(button, "kaomoji-button");
@@ -499,7 +500,8 @@ static void set_active_chip(MoeMojiWindow *self, int index) {
}
}
static void scroll_chip_into_view(MoeMojiWindow *self, GtkWidget *chip) {
static void scroll_chip_into_view(G_GNUC_UNUSED MoeMojiWindow *self,
GtkWidget *chip) {
GtkWidget *sw = gtk_widget_get_ancestor(chip, GTK_TYPE_SCROLLED_WINDOW);
if (!sw)
return;
@@ -536,7 +538,13 @@ static void on_chip_clicked(GtkButton *button, gpointer user_data) {
CategoryWidgets *cw = g_ptr_array_index(self->category_widgets, i);
if (cw->chip == GTK_WIDGET(button)) {
set_active_chip(self, (int)i);
scroll_to_category(self, (int)i);
graphene_point_t p;
if (gtk_widget_compute_point(cw->header, GTK_WIDGET(self->content_box),
&GRAPHENE_POINT_INIT(0, 0), &p)) {
GtkAdjustment *vadj = gtk_scrolled_window_get_vadjustment(
GTK_SCROLLED_WINDOW(self->kaomoji_scroll));
gtk_adjustment_set_value(vadj, p.y);
}
return;
}
}
@@ -938,7 +946,7 @@ static void on_chip_drag_begin(GtkDragSource *source,
static void clear_drop_indicator(GtkWidget *chip_box) {
GtkWidget *active = g_object_get_data(G_OBJECT(chip_box), "active-drop-sep");
if (active) {
gtk_widget_set_visible(active, FALSE);
gtk_widget_set_opacity(active, 0);
g_object_set_data(G_OBJECT(chip_box), "active-drop-sep", NULL);
}
}
@@ -956,7 +964,7 @@ static void show_drop_indicator(GtkWidget *chip, double y) {
else
sep = g_object_get_data(G_OBJECT(chip), "drop-sep-after");
if (sep) {
gtk_widget_set_visible(sep, TRUE);
gtk_widget_set_opacity(sep, 1);
g_object_set_data(G_OBJECT(chip_box), "active-drop-sep", sep);
}
}
@@ -1192,7 +1200,8 @@ static void reload_categories(MoeMojiWindow *self) {
GtkWidget *sep = gtk_box_new(GTK_ORIENTATION_HORIZONTAL, 0);
gtk_widget_add_css_class(sep, "chip-drop-line");
gtk_widget_set_size_request(sep, -1, 2);
gtk_widget_set_visible(sep, FALSE);
gtk_widget_set_opacity(sep, 0);
gtk_widget_set_can_target(sep, FALSE);
gtk_box_append(GTK_BOX(chip_box), sep);
g_object_set_data(G_OBJECT(btn), "drop-sep-before", sep);
if (i > 0) {
@@ -1207,7 +1216,8 @@ static void reload_categories(MoeMojiWindow *self) {
GtkWidget *tail = gtk_box_new(GTK_ORIENTATION_HORIZONTAL, 0);
gtk_widget_add_css_class(tail, "chip-drop-line");
gtk_widget_set_size_request(tail, -1, 2);
gtk_widget_set_visible(tail, FALSE);
gtk_widget_set_opacity(tail, 0);
gtk_widget_set_can_target(tail, FALSE);
gtk_box_append(GTK_BOX(chip_box), tail);
g_object_set_data(G_OBJECT(btn), "drop-sep-after", tail);
}
@@ -1806,12 +1816,31 @@ static void on_reset_kaomojis(G_GNUC_UNUSED GSimpleAction *action,
self);
}
static void reset_chip_controllers(MoeMojiWindow *self) {
for (guint i = 0; i < self->category_widgets->len; i++) {
CategoryWidgets *cw = g_ptr_array_index(self->category_widgets, i);
if (!cw->chip)
continue;
GListModel *controllers = gtk_widget_observe_controllers(cw->chip);
guint n = g_list_model_get_n_items(controllers);
for (guint j = 0; j < n; j++) {
GtkEventController *c = g_list_model_get_item(controllers, j);
if (GTK_IS_DRAG_SOURCE(c) || GTK_IS_DROP_TARGET(c))
gtk_event_controller_reset(c);
g_object_unref(c);
}
g_object_unref(controllers);
}
}
static void on_sidebar_toggled(GtkToggleButton *toggle, gpointer user_data) {
MoeMojiWindow *self = MOEMOJI_WINDOW(user_data);
gboolean active = gtk_toggle_button_get_active(toggle);
GtkWidget *start = gtk_paned_get_start_child(self->paned);
if (start)
gtk_widget_set_visible(start, active);
if (active)
reset_chip_controllers(self);
gtk_button_set_icon_name(GTK_BUTTON(toggle),
active ? "pan-start-symbolic" : "pan-end-symbolic");
}
+1 -1
View File
@@ -4,7 +4,7 @@
padding: 4px 8px;
}
.kaomoji-button label {
.kaomoji-label {
text-align: left;
text-shadow:
-1px -1px 0 rgba(0, 0, 0, 0.6),