mirror of
https://github.com/TakeV-Lambda/dino.git
synced 2024-11-24 16:04:38 +00:00
Small UI fixes for libAdwaita
This commit is contained in:
parent
6a182ba313
commit
99d9cb383a
9 changed files with 41 additions and 56 deletions
|
@ -90,7 +90,8 @@ set(RESOURCE_LIST
|
|||
unified_main_content.ui
|
||||
unified_window_placeholder.ui
|
||||
|
||||
theme.css
|
||||
style.css
|
||||
style-dark.css
|
||||
)
|
||||
|
||||
compile_gresources(
|
||||
|
|
|
@ -31,7 +31,9 @@
|
|||
<property name="halign">end</property>
|
||||
<property name="valign">start</property>
|
||||
<style>
|
||||
<class name="linked"/>
|
||||
<class name="card"/>
|
||||
<class name="toolbar"/>
|
||||
<class name="overlay-toolbar"/>
|
||||
</style>
|
||||
</object>
|
||||
</child>
|
||||
|
|
|
@ -144,7 +144,7 @@
|
|||
<property name="margin-start">5</property>
|
||||
<style>
|
||||
<class name="conversation_list_row_xbutton"/>
|
||||
<class name="circular-button"/>
|
||||
<class name="circular"/>
|
||||
<class name="flat"/>
|
||||
</style>
|
||||
<child>
|
||||
|
|
|
@ -31,7 +31,8 @@
|
|||
<property name="halign">end</property>
|
||||
<property name="valign">end</property>
|
||||
<style>
|
||||
<class name="circular-button"/>
|
||||
<class name="circular"/>
|
||||
<class name="opaque"/>
|
||||
</style>
|
||||
<child>
|
||||
<object class="GtkImage">
|
||||
|
|
3
main/data/style-dark.css
Normal file
3
main/data/style-dark.css
Normal file
|
@ -0,0 +1,3 @@
|
|||
.dino-main .overlay-toolbar {
|
||||
background-color: shade(@view_bg_color, 1.5);
|
||||
}
|
|
@ -43,7 +43,7 @@ window.dino-main .dino-conversation .highlight-once {
|
|||
}
|
||||
|
||||
window.dino-main .dino-conversation .message-box.highlight {
|
||||
background: alpha(@theme_fg_color, 0.04);
|
||||
background: @window_bg_color;
|
||||
}
|
||||
|
||||
window.dino-main .dino-conversation .message-box {
|
||||
|
@ -92,11 +92,6 @@ window.dino-main .dino-sidebar > frame {
|
|||
transition: background .05s ease;
|
||||
}
|
||||
|
||||
window.dino-main .circular-button {
|
||||
padding: 0;
|
||||
border-radius: 1000px;
|
||||
}
|
||||
|
||||
window.dino-main .dino-conversation .message-box.edit-mode {
|
||||
background: alpha(@theme_selected_bg_color, 0.1);
|
||||
}
|
||||
|
@ -124,17 +119,17 @@ window.dino-main .dino-quote:hover {
|
|||
background: alpha(@theme_fg_color, 0.08);
|
||||
}
|
||||
|
||||
/* Message Menu */
|
||||
/* Overlay Toolbar */
|
||||
|
||||
.message-menu-box {
|
||||
background-color: @theme_base_color;
|
||||
border: 1px solid alpha(@theme_fg_color, 0.15);
|
||||
border-radius: 5px;
|
||||
.dino-main .overlay-toolbar {
|
||||
padding: 2px;
|
||||
border-radius: 6px;
|
||||
border-spacing: 0;
|
||||
}
|
||||
|
||||
.message-menu-button {
|
||||
padding: 6px;
|
||||
border: none;
|
||||
.dino-main .overlay-toolbar > * {
|
||||
margin-top: 0;
|
||||
margin-bottom: 0;
|
||||
}
|
||||
|
||||
/* Fie Widget */
|
||||
|
@ -189,38 +184,23 @@ window.dino-main .multiparty-participants {
|
|||
|
||||
/* Reactions */
|
||||
|
||||
window.dino-main menubutton.reaction-box image {
|
||||
margin-left: 5px;
|
||||
margin-right: 5px;
|
||||
.dino-main .reaction-grid button {
|
||||
min-height: 16px;
|
||||
min-width: 30px;
|
||||
padding: 4px;
|
||||
}
|
||||
|
||||
window.dino-main button.reaction-box,
|
||||
window.dino-main menubutton.reaction-box > button {
|
||||
border: 1px solid transparent;
|
||||
padding: 3px 5px ;
|
||||
border-radius: 10px;
|
||||
background-color: alpha(@theme_fg_color, 0.07);
|
||||
background-image: none;
|
||||
box-shadow: none;
|
||||
min-height: 0;
|
||||
min-width: 0;
|
||||
.dino-main .reaction-grid button.own-reaction,
|
||||
.dino-main .reaction-grid .own-reaction button {
|
||||
background-color: alpha(@accent_bg_color, 0.1);
|
||||
border: 1px solid @accent_bg_color;
|
||||
padding: 3px;
|
||||
color: @accent_color;
|
||||
}
|
||||
|
||||
window.dino-main button.reaction-box.own-reaction,
|
||||
window.dino-main menubutton.reaction-box.own-reaction > button {
|
||||
color: mix(@theme_selected_bg_color, @theme_fg_color, 0.4);
|
||||
border-color: @theme_selected_bg_color;
|
||||
background-color: alpha(@theme_selected_bg_color, 0.05);
|
||||
}
|
||||
|
||||
window.dino-main button.reaction-box:hover,
|
||||
window.dino-main menubutton.reaction-box:hover > button {
|
||||
background-color: alpha(@theme_fg_color, 0.1);
|
||||
}
|
||||
|
||||
window.dino-main button.reaction-box.own-reaction:hover,
|
||||
window.dino-main menubutton.reaction-box.own-reaction > button {
|
||||
background-color: alpha(@theme_selected_bg_color, 0.2);
|
||||
.dino-main .reaction-grid button.own-reaction:hover,
|
||||
.dino-main .reaction-grid .own-reaction button:hover {
|
||||
background-color: alpha(@accent_bg_color, 0.2);
|
||||
}
|
||||
|
||||
/* Sidebar */
|
|
@ -33,10 +33,6 @@ public class Dino.Ui.Application : Adw.Application, Dino.Application {
|
|||
Environment.set_application_name("Dino");
|
||||
Window.set_default_icon_name("im.dino.Dino");
|
||||
|
||||
CssProvider provider = new CssProvider();
|
||||
provider.load_from_resource("/im/dino/Dino/theme.css");
|
||||
StyleContext.add_provider_for_display(Gdk.Display.get_default(), provider, STYLE_PROVIDER_PRIORITY_APPLICATION);
|
||||
|
||||
create_actions();
|
||||
add_main_option_entries(options);
|
||||
|
||||
|
|
|
@ -9,6 +9,7 @@ namespace Dino.Ui.ConversationSummary {
|
|||
|
||||
[GtkTemplate (ui = "/im/dino/Dino/conversation_content_view/view.ui")]
|
||||
public class ConversationView : Widget, Plugins.ConversationItemCollection, Plugins.NotificationCollection {
|
||||
private const int MESSAGE_MENU_BOX_OFFSET = -20;
|
||||
|
||||
public Conversation? conversation { get; private set; }
|
||||
|
||||
|
@ -173,7 +174,7 @@ public class ConversationView : Widget, Plugins.ConversationItemCollection, Plug
|
|||
currently_highlighted.add_css_class("highlight");
|
||||
|
||||
// Move message menu
|
||||
message_menu_box.margin_top = (int)(widget_y - 10);
|
||||
message_menu_box.margin_top = (int)(widget_y + MESSAGE_MENU_BOX_OFFSET);
|
||||
}
|
||||
}
|
||||
|
||||
|
|
|
@ -123,9 +123,10 @@ public class ReactionsWidget : Grid {
|
|||
public ReactionsWidget() {
|
||||
this.row_spacing = this.column_spacing = 5;
|
||||
this.margin_top = 2;
|
||||
this.add_css_class("reaction-grid");
|
||||
|
||||
add_button = new MenuButton() { tooltip_text= _("Add reaction") };
|
||||
add_button.get_style_context().add_class("reaction-box");
|
||||
add_button.add_css_class("pill");
|
||||
Util.menu_button_set_icon_with_size(add_button, "dino-emoticon-add-symbolic", 14);
|
||||
|
||||
EmojiChooser chooser = new EmojiChooser();
|
||||
|
@ -140,8 +141,8 @@ public class ReactionsWidget : Grid {
|
|||
Label reaction_label = new Label("<span size='small'>" + reaction + "</span>") { use_markup=true };
|
||||
Label count_label = new Label("") { use_markup=true };
|
||||
Button button = new Button();
|
||||
button.get_style_context().add_class("reaction-box");
|
||||
Box reaction_box = new Box(Orientation.HORIZONTAL, 4);
|
||||
button.add_css_class("pill");
|
||||
Box reaction_box = new Box(Orientation.HORIZONTAL, 4) { halign=Align.CENTER };
|
||||
reaction_box.append(reaction_label);
|
||||
reaction_box.append(count_label);
|
||||
button.set_child(reaction_box);
|
||||
|
@ -161,9 +162,9 @@ public class ReactionsWidget : Grid {
|
|||
|
||||
reaction_counts[reaction].label = "<span font_family='monospace' size='small'>" + count.to_string() + "</span>";
|
||||
if (own) {
|
||||
reaction_buttons[reaction].get_style_context().add_class("own-reaction");
|
||||
reaction_buttons[reaction].add_css_class("own-reaction");
|
||||
} else {
|
||||
reaction_buttons[reaction].get_style_context().remove_class("own-reaction");
|
||||
reaction_buttons[reaction].remove_css_class("own-reaction");
|
||||
}
|
||||
|
||||
// Build tooltip
|
||||
|
|
Loading…
Reference in a new issue