feat: add record/category management, imports and exports
This commit is contained in:
+1
-1
@@ -27,7 +27,7 @@ static void register_with_portal (void) {
|
||||
G_DBUS_CALL_FLAGS_NONE,
|
||||
-1, NULL, &error);
|
||||
if (result == NULL) {
|
||||
g_info ("portal register: %s", error->message);
|
||||
g_warning ("portal register: %s", error->message);
|
||||
g_clear_error (&error);
|
||||
} else {
|
||||
g_variant_unref (result);
|
||||
|
||||
@@ -301,8 +301,8 @@ static void setup_sni(MoeMojiApplication *self) {
|
||||
GVariant *result = g_dbus_connection_call_sync(
|
||||
self->dbus_conn, "org.freedesktop.DBus", "/org/freedesktop/DBus",
|
||||
"org.freedesktop.DBus", "NameHasOwner",
|
||||
g_variant_new("(s)", "org.kde.StatusNotifierWatcher"), G_VARIANT_TYPE("(b)"),
|
||||
G_DBUS_CALL_FLAGS_NONE, -1, NULL, &error);
|
||||
g_variant_new("(s)", "org.kde.StatusNotifierWatcher"),
|
||||
G_VARIANT_TYPE("(b)"), G_DBUS_CALL_FLAGS_NONE, -1, NULL, &error);
|
||||
if (result == NULL) {
|
||||
g_warning("NameHasOwner check failed: %s", error->message);
|
||||
g_clear_error(&error);
|
||||
@@ -354,10 +354,10 @@ static void setup_sni(MoeMojiApplication *self) {
|
||||
}
|
||||
const gchar *unique_name = g_dbus_connection_get_unique_name(self->dbus_conn);
|
||||
g_dbus_connection_call(
|
||||
self->dbus_conn, "org.kde.StatusNotifierWatcher", "/StatusNotifierWatcher",
|
||||
"org.kde.StatusNotifierWatcher", "RegisterStatusNotifierItem",
|
||||
g_variant_new("(s)", unique_name), NULL, G_DBUS_CALL_FLAGS_NONE, -1,
|
||||
NULL, NULL, NULL);
|
||||
self->dbus_conn, "org.kde.StatusNotifierWatcher",
|
||||
"/StatusNotifierWatcher", "org.kde.StatusNotifierWatcher",
|
||||
"RegisterStatusNotifierItem", g_variant_new("(s)", unique_name), NULL,
|
||||
G_DBUS_CALL_FLAGS_NONE, -1, NULL, NULL, NULL);
|
||||
}
|
||||
|
||||
static void on_shortcuts_activated(G_GNUC_UNUSED GDBusProxy *proxy,
|
||||
@@ -593,8 +593,8 @@ static void moemoji_application_show_about(G_GNUC_UNUSED GSimpleAction *action,
|
||||
GtkWindow *window = NULL;
|
||||
g_return_if_fail(MOEMOJI_IS_APPLICATION(self));
|
||||
window = gtk_application_get_active_window(GTK_APPLICATION(self));
|
||||
gtk_show_about_dialog(window, "program-name", "MoeMoji", "version", "0.1.0",
|
||||
NULL);
|
||||
gtk_show_about_dialog(window, "program-name", "MoeMoji", "version",
|
||||
PACKAGE_VERSION, NULL);
|
||||
}
|
||||
|
||||
static void moemoji_application_class_init(MoeMojiApplicationClass *klass) {
|
||||
|
||||
+969
-49
File diff suppressed because it is too large
Load Diff
@@ -20,6 +20,16 @@ struct _MoeMojiWindow {
|
||||
GPtrArray *category_widgets;
|
||||
GtkWidget *bottom_spacer;
|
||||
int active_chip_index;
|
||||
GtkStack *view_stack;
|
||||
GtkWidget *add_button;
|
||||
GtkWidget *back_button;
|
||||
GtkWidget *menu_button;
|
||||
GtkEntry *category_name_entry;
|
||||
GtkWidget *entry_text_view;
|
||||
GtkWidget *category_save_button;
|
||||
char *selected_category_dir;
|
||||
gulong scroll_handler_id;
|
||||
gulong page_size_handler_id;
|
||||
};
|
||||
|
||||
G_BEGIN_DECLS
|
||||
|
||||
+68
-21
@@ -10,37 +10,84 @@
|
||||
<child type="titlebar">
|
||||
<object class="AdwHeaderBar" id="header_bar">
|
||||
<property name="show-end-title-buttons">True</property>
|
||||
<child type="start">
|
||||
<object class="GtkButton" id="add_button">
|
||||
<property name="icon-name">list-add-symbolic</property>
|
||||
</object>
|
||||
</child>
|
||||
<child type="start">
|
||||
<object class="GtkButton" id="back_button">
|
||||
<property name="icon-name">go-previous-symbolic</property>
|
||||
<property name="visible">False</property>
|
||||
</object>
|
||||
</child>
|
||||
<child type="end">
|
||||
<object class="GtkMenuButton" id="menu_button">
|
||||
<property name="icon-name">open-menu-symbolic</property>
|
||||
<property name="menu-model">primary_menu</property>
|
||||
</object>
|
||||
</child>
|
||||
</object>
|
||||
</child>
|
||||
|
||||
<child>
|
||||
<object class="GtkBox" id="outer_box">
|
||||
<property name="orientation">vertical</property>
|
||||
<object class="GtkStack" id="view_stack">
|
||||
<property name="transition-type">slide-left</property>
|
||||
<property name="transition-duration">200</property>
|
||||
<child>
|
||||
<object class="GtkSearchEntry" id="search_entry">
|
||||
<property name="placeholder-text">Jump to category...</property>
|
||||
<property name="margin-start">6</property>
|
||||
<property name="margin-end">6</property>
|
||||
<property name="margin-top">6</property>
|
||||
</object>
|
||||
</child>
|
||||
<child>
|
||||
<object class="GtkScrolledWindow" id="kaomoji_scroll">
|
||||
<property name="hscrollbar-policy">never</property>
|
||||
<property name="vexpand">True</property>
|
||||
<child>
|
||||
<object class="GtkBox" id="content_box">
|
||||
<object class="GtkStackPage">
|
||||
<property name="name">main</property>
|
||||
<property name="child">
|
||||
<object class="GtkBox" id="outer_box">
|
||||
<property name="orientation">vertical</property>
|
||||
<property name="margin-start">6</property>
|
||||
<property name="margin-end">6</property>
|
||||
<property name="margin-top">6</property>
|
||||
<property name="margin-bottom">6</property>
|
||||
<property name="spacing">4</property>
|
||||
<child>
|
||||
<object class="GtkSearchEntry" id="search_entry">
|
||||
<property name="placeholder-text">Jump to category...</property>
|
||||
<property name="margin-start">6</property>
|
||||
<property name="margin-end">6</property>
|
||||
<property name="margin-top">6</property>
|
||||
</object>
|
||||
</child>
|
||||
<child>
|
||||
<object class="GtkScrolledWindow" id="kaomoji_scroll">
|
||||
<property name="hscrollbar-policy">never</property>
|
||||
<property name="vexpand">True</property>
|
||||
<child>
|
||||
<object class="GtkBox" id="content_box">
|
||||
<property name="orientation">vertical</property>
|
||||
<property name="margin-start">6</property>
|
||||
<property name="margin-end">6</property>
|
||||
<property name="margin-top">6</property>
|
||||
<property name="margin-bottom">6</property>
|
||||
<property name="spacing">4</property>
|
||||
</object>
|
||||
</child>
|
||||
</object>
|
||||
</child>
|
||||
</object>
|
||||
</child>
|
||||
</property>
|
||||
</object>
|
||||
</child>
|
||||
</object>
|
||||
</child>
|
||||
</template>
|
||||
|
||||
<menu id="primary_menu">
|
||||
<section>
|
||||
<item>
|
||||
<attribute name="label" translatable="yes">Manage…</attribute>
|
||||
<attribute name="action">win.manage</attribute>
|
||||
</item>
|
||||
</section>
|
||||
<section>
|
||||
<item>
|
||||
<attribute name="label" translatable="yes">Export…</attribute>
|
||||
<attribute name="action">win.export</attribute>
|
||||
</item>
|
||||
<item>
|
||||
<attribute name="label" translatable="yes">Import…</attribute>
|
||||
<attribute name="action">win.import</attribute>
|
||||
</item>
|
||||
</section>
|
||||
</menu>
|
||||
</interface>
|
||||
+48
-1
@@ -37,7 +37,7 @@
|
||||
color: white;
|
||||
}
|
||||
|
||||
wallpaper-bg > * {
|
||||
.wallpaper-bg > * {
|
||||
background-color: transparent;
|
||||
}
|
||||
|
||||
@@ -59,3 +59,50 @@ wallpaper-bg > * {
|
||||
background-color: rgba(255, 255, 255, 0.25);
|
||||
border-radius: 8px;
|
||||
}
|
||||
|
||||
.add-choice-button {
|
||||
min-width: 200px;
|
||||
min-height: 48px;
|
||||
font-size: 16px;
|
||||
}
|
||||
|
||||
.add-form {
|
||||
padding: 24px;
|
||||
margin: 12px;
|
||||
}
|
||||
|
||||
.entry-editor-frame {
|
||||
background-color: rgba(0, 0, 0, 0.5);
|
||||
border-radius: 12px;
|
||||
overflow: hidden;
|
||||
}
|
||||
|
||||
.entry-text-view, .entry-text-view text {
|
||||
background-color: transparent;
|
||||
color: white;
|
||||
caret-color: white;
|
||||
}
|
||||
|
||||
.manage-emote {
|
||||
border: 1px solid rgba(255, 255, 255, 0.3);
|
||||
border-radius: 8px;
|
||||
padding: 6px 10px;
|
||||
}
|
||||
|
||||
.manage-delete {
|
||||
min-width: 20px;
|
||||
min-height: 20px;
|
||||
padding: 2px;
|
||||
font-size: 10px;
|
||||
background-color: @destructive_bg_color;
|
||||
color: @destructive_fg_color;
|
||||
}
|
||||
|
||||
.manage-cat-delete {
|
||||
min-width: 24px;
|
||||
min-height: 24px;
|
||||
padding: 2px;
|
||||
background-color: @destructive_bg_color;
|
||||
color: @destructive_fg_color;
|
||||
}
|
||||
|
||||
|
||||
Reference in New Issue
Block a user