feat: moved category chips to a sidebar, added pinning; category names are not restricted to ASCII chars anymore

This commit is contained in:
2026-03-07 23:00:00 +03:00
parent 95608a3fd6
commit 5032527966
723 changed files with 1050 additions and 392 deletions
+813 -304
View File
File diff suppressed because it is too large Load Diff
+12 -2
View File
@@ -1,22 +1,25 @@
#pragma once
#include <gtk/gtk.h>
#include <adwaita.h>
typedef struct {
GtkWidget *header;
GtkWidget *flow;
GtkWidget *chip;
char *name;
char *path;
} CategoryWidgets;
struct _MoeMojiWindow {
GtkApplicationWindow parent_instance;
GtkBox *wrapper_box;
GtkPaned *paned;
GtkBox *right_pane;
GtkBox *outer_box;
GtkBox *content_box;
GtkSearchEntry *search_entry;
GtkWidget *header_bar;
GtkBox *category_bar;
GtkWidget *sidebar_toggle;
GtkWidget *kaomoji_scroll;
GPtrArray *category_widgets;
GtkWidget *bottom_spacer;
@@ -30,9 +33,16 @@ struct _MoeMojiWindow {
GtkEntry *category_name_entry;
GtkWidget *entry_text_view;
GtkWidget *category_save_button;
GtkWidget *category_error_label;
char *selected_category_dir;
gulong scroll_handler_id;
gulong page_size_handler_id;
char *ctx_cat_path;
char *ctx_cat_name;
char *ctx_emote_path;
char *ctx_emote_text;
GtkBox *pinned_box;
AdwToastOverlay *toast_overlay;
};
G_BEGIN_DECLS
+62 -37
View File
@@ -2,55 +2,80 @@
<interface>
<requires lib="gtk" version="4.0" />
<template class="MoeMojiWindow" parent="GtkApplicationWindow">
<property name="default-width">680</property>
<property name="default-height">400</property>
<property name="default-width">800</property>
<property name="default-height">500</property>
<property name="resizable">True</property>
<property name="title">MoeMoji</property>
<child>
<object class="GtkBox" id="wrapper_box">
<property name="orientation">vertical</property>
<child>
<object class="GtkStack" id="view_stack">
<property name="transition-type">slide-left</property>
<property name="transition-duration">200</property>
<property name="vexpand">True</property>
<child>
<object class="GtkStackPage">
<property name="name">main</property>
<property name="child">
<object class="GtkBox" id="outer_box">
<property name="orientation">vertical</property>
<object class="GtkPaned" id="paned">
<property name="orientation">horizontal</property>
<property name="shrink-start-child">False</property>
<property name="resize-start-child">False</property>
<property name="shrink-end-child">False</property>
<property name="start-child">
<object class="GtkBox" id="sidebar_placeholder">
<property name="visible">False</property>
</object>
</property>
<property name="end-child">
<object class="AdwToastOverlay" id="toast_overlay">
<property name="child">
<object class="GtkBox" id="right_pane">
<property name="orientation">vertical</property>
<property name="hexpand">True</property>
<child>
<object class="GtkStack" id="view_stack">
<property name="transition-type">slide-left</property>
<property name="transition-duration">200</property>
<property name="vexpand">True</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="GtkBox">
<property name="orientation">horizontal</property>
<property name="spacing">4</property>
<property name="margin-start">6</property>
<property name="margin-end">6</property>
<property name="margin-top">6</property>
<child>
<object class="GtkSearchEntry" id="search_entry">
<property name="placeholder-text">Search!!!</property>
<property name="hexpand">True</property>
</object>
</child>
</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>
</property>
</child>
</object>
</child>
</property>
</object>
</child>
</property>
</object>
</child>
</template>
+31 -27
View File
@@ -6,7 +6,11 @@
.kaomoji-button label {
text-align: left;
text-shadow: -1px -1px 2px rgba(102, 34, 74, 0.8), 1px -1px 0 rgba(102, 34, 74, 0.8), -1px 1px 0 rgba(102, 34, 74, 0.8), 1px 1px 0 rgba(102, 34, 74, 0.8);
text-shadow:
-1px -1px 0 rgba(0, 0, 0, 0.6),
1px -1px 0 rgba(0, 0, 0, 0.6),
-1px 1px 0 rgba(0, 0, 0, 0.6),
1px 1px 0 rgba(0, 0, 0, 0.6);
}
.kaomoji-wide {
@@ -46,9 +50,9 @@
}
.category-bar {
background-color: rgba(0, 0, 0, 0.4);
border-radius: 14px;
padding: 8px;
border-radius: 0;
padding: 4px;
min-width: 140px;
}
.chip-active {
@@ -79,34 +83,34 @@
caret-color: white;
}
.manage-emote {
border: 1px solid rgba(255, 255, 255, 0.3);
border-radius: 8px;
padding: 6px 10px;
.context-menu-popover contents {
padding: 4px;
}
.manage-delete {
min-width: 20px;
min-height: 20px;
padding: 2px;
font-size: 10px;
background-color: @destructive_bg_color;
color: @destructive_fg_color;
.error-label {
color: #ff6b6b;
font-size: 12px;
}
.manage-cat-rename {
min-width: 24px;
min-height: 24px;
padding: 2px;
background-color: #c8a600;
color: white;
.context-active {
background-color: rgba(255, 255, 255, 0.15);
border-radius: 6px;
}
.manage-cat-delete {
min-width: 24px;
min-height: 24px;
padding: 2px;
background-color: @destructive_bg_color;
color: @destructive_fg_color;
.chip-drop-line {
background-color: rgba(0, 0, 0, 0.6);
border-radius: 1px;
}
.pinned-header {
font-size: 11px;
font-weight: bold;
padding: 4px 8px 2px 8px;
opacity: 0.7;
}
.pinned-section {
margin-top: 4px;
border-top: 1px solid rgba(255, 255, 255, 0.15);
}