Projects
home:Eustace:branches:Eulaceura:Factory
mate-notification-daemon
_service:obs_scm:0004-fix-UI-set-the-text-box-f...
Sign Up
Log In
Username
Password
Overview
Repositories
Revisions
Requests
Users
Attributes
Meta
File _service:obs_scm:0004-fix-UI-set-the-text-box-fill-the-extra-space-in-wind.patch of Package mate-notification-daemon
From 19276cbc3d1b205354390e75b209a521c098e8d0 Mon Sep 17 00:00:00 2001 From: yuanxing <yuanxing@kylinos.com.cn> Date: Fri, 22 Jan 2021 18:33:56 +0800 Subject: [PATCH 3/9] fix(UI):set the text box fill the extra space in window when text is short MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit - 当文字很短时,将中间文字控件占满窗口额外的空间 Realated #33420 --- src/themes/kiran/data/kiran.css | 7 +++++++ src/themes/kiran/kiran.c | 20 +++++++++++--------- 2 files changed, 18 insertions(+), 9 deletions(-) diff --git a/src/themes/kiran/data/kiran.css b/src/themes/kiran/data/kiran.css index 0e00f1c..b85dc2f 100644 --- a/src/themes/kiran/data/kiran.css +++ b/src/themes/kiran/data/kiran.css @@ -95,10 +95,17 @@ #action_vbox { border: none; + background-color: red; } #actions_box { margin-right: 2px; + background-color: purple; } + +#text_vbox +{ + background-color: seagreen; +} \ No newline at end of file diff --git a/src/themes/kiran/kiran.c b/src/themes/kiran/kiran.c index a99af72..ac8d471 100644 --- a/src/themes/kiran/kiran.c +++ b/src/themes/kiran/kiran.c @@ -94,13 +94,13 @@ void notification_tick(GtkWindow *nw, glong remaining); #define STRIPE_WIDTH 32 #define WIDTH 380 -#define IMAGE_SIZE 32 -#define IMAGE_PADDING 10 +#define IMAGE_SIZE 48 +#define IMAGE_PADDING 12 #define SPACER_LEFT 30 #define PIE_RADIUS 7 #define PIE_WIDTH (2 * PIE_RADIUS) #define PIE_HEIGHT (2 * PIE_RADIUS) -#define BODY_X_OFFSET (IMAGE_SIZE + 8) +#define BODY_X_OFFSET (IMAGE_SIZE + 24) #define DEFAULT_ARROW_OFFSET (SPACER_LEFT + 12) #define DEFAULT_ARROW_HEIGHT 14 #define DEFAULT_ARROW_WIDTH 22 @@ -596,10 +596,10 @@ create_notification(UrlClickedCb url_clicked) windata->main_hbox = gtk_box_new (GTK_ORIENTATION_HORIZONTAL, 0); gtk_widget_set_name(windata->main_hbox , "main_hbox"); - gtk_widget_set_halign (windata->main_hbox, GTK_ALIGN_START); + gtk_widget_set_halign (windata->main_hbox, GTK_ALIGN_FILL); gtk_widget_set_valign (windata->main_hbox, GTK_ALIGN_START); gtk_widget_show (windata->main_hbox); - gtk_box_pack_start (GTK_BOX(main_vbox), windata->main_hbox, FALSE, TRUE, 0); + gtk_box_pack_start (GTK_BOX(main_vbox), windata->main_hbox, TRUE, TRUE, 0); /* The icon goes at the left */ windata->iconbox = gtk_box_new(GTK_ORIENTATION_VERTICAL, 0); @@ -616,9 +616,10 @@ create_notification(UrlClickedCb url_clicked) /* The title and the text at the right */ vbox = gtk_box_new (GTK_ORIENTATION_VERTICAL, 0); gtk_widget_set_name(vbox , "text_vbox"); - gtk_widget_set_halign (vbox, GTK_ALIGN_START); + gtk_widget_set_halign (vbox, GTK_ALIGN_FILL); gtk_widget_show (vbox); - gtk_box_pack_start (GTK_BOX (windata->main_hbox), vbox, FALSE, FALSE, 0); + gtk_box_pack_start (GTK_BOX (windata->main_hbox), vbox, TRUE, TRUE, 0); + gtk_widget_set_hexpand (vbox, TRUE); /* Add action_vbox*/ @@ -681,7 +682,7 @@ create_notification(UrlClickedCb url_clicked) gtk_label_set_line_wrap(GTK_LABEL(windata->body_label), TRUE); gtk_label_set_line_wrap_mode (GTK_LABEL (windata->body_label), PANGO_WRAP_WORD_CHAR); gtk_label_set_max_width_chars (GTK_LABEL (windata->body_label), 50); - gtk_widget_set_vexpand (windata->body_label, FALSE); + gtk_widget_set_vexpand (windata->body_label, TRUE); g_signal_connect(G_OBJECT(windata->body_label), "activate-link", G_CALLBACK(activate_link), windata); @@ -727,8 +728,9 @@ set_notification_text(GtkWindow *nw, const char *summary, const char *body) gtk_widget_set_size_request( ((body != NULL && *body != '\0') ? windata->body_label : windata->summary_label), - WIDTH - (IMAGE_SIZE + IMAGE_PADDING) - 60, + WIDTH - (IMAGE_SIZE + IMAGE_PADDING*2) -40, -1); + } /* Set notification icon */ -- 2.27.0
Locations
Projects
Search
Status Monitor
Help
Open Build Service
OBS Manuals
API Documentation
OBS Portal
Reporting a Bug
Contact
Mailing List
Forums
Chat (IRC)
Twitter
Open Build Service (OBS)
is an
openSUSE project
.
浙ICP备2022010568号-2