145 lines
4.0 KiB
Diff
145 lines
4.0 KiB
Diff
From eca0ea6e009c6f4f1edca2baa70004b217a533a2 Mon Sep 17 00:00:00 2001
|
|
From: yuanxing <yuanxing@kylinos.com.cn>
|
|
Date: Wed, 7 Dec 2022 11:08:08 +0800
|
|
Subject: [PATCH] fix(kiran):remove pie draw in kiran
|
|
MIME-Version: 1.0
|
|
Content-Type: text/plain; charset=UTF-8
|
|
Content-Transfer-Encoding: 8bit
|
|
|
|
- 在kiran主题中去除饼图倒计时功能
|
|
---
|
|
src/themes/kiran/kiran.c | 91 ----------------------------------------
|
|
1 file changed, 91 deletions(-)
|
|
|
|
diff --git a/src/themes/kiran/kiran.c b/src/themes/kiran/kiran.c
|
|
index 7f6b9b1..b7ba1cd 100644
|
|
--- a/src/themes/kiran/kiran.c
|
|
+++ b/src/themes/kiran/kiran.c
|
|
@@ -200,27 +200,6 @@ fill_background_when_pointer_enter(GtkWidget *widget, WindowData *windata, cairo
|
|
cairo_fill(cr);
|
|
}
|
|
|
|
-static void
|
|
-draw_pie(GtkWidget *pie, WindowData *windata, cairo_t *cr)
|
|
-{
|
|
- if (windata->timeout == 0)
|
|
- return;
|
|
-
|
|
- gdouble arc_angle = 1.0 - (gdouble)windata->remaining / (gdouble)windata->timeout;
|
|
- cairo_set_source_rgba(cr,
|
|
- 92 / 255.0,
|
|
- 92 / 255.0,
|
|
- 92 / 255.0, 1);
|
|
- cairo_move_to(cr, PIE_RADIUS, PIE_RADIUS);
|
|
- cairo_arc_negative(cr,
|
|
- PIE_RADIUS, PIE_RADIUS,
|
|
- PIE_RADIUS,
|
|
- -G_PI / 2, (-0.25 + arc_angle) * 2 * G_PI);
|
|
- cairo_line_to(cr, PIE_RADIUS, PIE_RADIUS);
|
|
-
|
|
- cairo_fill(cr);
|
|
-}
|
|
-
|
|
static void
|
|
update_shape_region(cairo_surface_t *surface,
|
|
WindowData *windata)
|
|
@@ -354,52 +333,6 @@ on_draw(GtkWidget *widget, cairo_t *cr, WindowData *windata)
|
|
return FALSE;
|
|
}
|
|
|
|
-static gboolean
|
|
-countdown_expose_cb(GtkWidget *pie,
|
|
- cairo_t *cr,
|
|
- WindowData *windata)
|
|
-{
|
|
- cairo_t *cr2;
|
|
- cairo_surface_t *surface;
|
|
- GtkAllocation alloc;
|
|
-
|
|
- cairo_set_operator(cr, CAIRO_OPERATOR_SOURCE);
|
|
-
|
|
- gtk_widget_get_allocation(pie, &alloc);
|
|
-
|
|
- surface = cairo_surface_create_similar(cairo_get_target(cr),
|
|
- CAIRO_CONTENT_COLOR_ALPHA,
|
|
- alloc.width,
|
|
- alloc.height);
|
|
-
|
|
- cr2 = cairo_create(surface);
|
|
-
|
|
- cairo_translate(cr2, -alloc.x, -alloc.y);
|
|
-
|
|
- GtkStateFlags flags = gtk_widget_get_state_flags(windata->win);
|
|
- if (flags & GTK_STATE_FLAG_PRELIGHT)
|
|
- {
|
|
- fill_background_when_pointer_enter(pie, windata, cr2);
|
|
- }
|
|
- else
|
|
- {
|
|
- fill_background(pie, windata, cr2);
|
|
- }
|
|
- cairo_translate(cr2, alloc.x, alloc.y);
|
|
- draw_pie(pie, windata, cr2);
|
|
- cairo_fill(cr2);
|
|
-
|
|
- cairo_destroy(cr2);
|
|
-
|
|
- cairo_save(cr);
|
|
- cairo_set_source_surface(cr, surface, 0, 0);
|
|
- cairo_paint(cr);
|
|
- cairo_restore(cr);
|
|
-
|
|
- cairo_surface_destroy(surface);
|
|
- return TRUE;
|
|
-}
|
|
-
|
|
static gboolean
|
|
on_configure_event(GtkWidget *widget, GdkEventConfigure *event, WindowData *windata)
|
|
{
|
|
@@ -766,19 +699,6 @@ void add_notification_action(GtkWindow *nw,
|
|
if (gtk_widget_get_visible(windata->actions_box))
|
|
{
|
|
gtk_widget_show(windata->actions_box);
|
|
- /* Don't try to re-add a pie_countdown */
|
|
- if (!windata->pie_countdown)
|
|
- {
|
|
- windata->pie_countdown = gtk_drawing_area_new();
|
|
- gtk_widget_set_halign(windata->pie_countdown, GTK_ALIGN_END);
|
|
- gtk_widget_set_valign(windata->pie_countdown, GTK_ALIGN_END);
|
|
- gtk_widget_show(windata->pie_countdown);
|
|
-
|
|
- gtk_box_pack_end(GTK_BOX(windata->actions_box), windata->pie_countdown, FALSE, FALSE, 0);
|
|
- gtk_widget_set_size_request(windata->pie_countdown, PIE_WIDTH, PIE_HEIGHT);
|
|
- g_signal_connect(G_OBJECT(windata->pie_countdown), "draw",
|
|
- G_CALLBACK(countdown_expose_cb), windata);
|
|
- }
|
|
}
|
|
|
|
if (windata->action_icons)
|
|
@@ -846,8 +766,6 @@ void clear_notification_actions(GtkWindow *nw)
|
|
{
|
|
WindowData *windata = g_object_get_data(G_OBJECT(nw), "windata");
|
|
|
|
- windata->pie_countdown = NULL;
|
|
-
|
|
gtk_widget_hide(windata->actions_box);
|
|
gtk_container_foreach(GTK_CONTAINER(windata->actions_box),
|
|
(GtkCallback)gtk_widget_destroy, NULL);
|
|
@@ -916,13 +834,4 @@ void notification_tick(GtkWindow *nw, glong remaining)
|
|
{
|
|
WindowData *windata = g_object_get_data(G_OBJECT(nw), "windata");
|
|
windata->remaining = remaining;
|
|
-
|
|
- if (windata->pie_countdown != NULL)
|
|
- {
|
|
- gtk_widget_queue_draw_area(windata->pie_countdown,
|
|
- 0,
|
|
- 0,
|
|
- PIE_WIDTH,
|
|
- PIE_HEIGHT);
|
|
- }
|
|
}
|
|
--
|
|
2.36.1
|
|
|