kiran-menu/1010-fix-tasklist-app-widget-Fixed-the-taskbar-page-turni.patch
2024-04-09 18:20:17 +08:00

177 lines
8.6 KiB
Diff
Raw Blame History

This file contains invisible Unicode characters

This file contains invisible Unicode characters that are indistinguishable to humans but may be processed differently by a computer. If you think that this is intentional, you can safely ignore this warning. Use the Escape button to reveal them.

From e87333e61da73cb79f44697aa7a62207dea78ebc Mon Sep 17 00:00:00 2001
From: yangfeng <yangfeng@kylinsec.com.cn>
Date: Tue, 19 Mar 2024 15:57:38 +0800
Subject: [PATCH 1010/1014] fix(tasklist-app-widget):Fixed the taskbar
page-turning ICONS hiding each other when zoom rate was 200%
MIME-Version: 1.0
Content-Type: text/plain; charset=UTF-8
Content-Transfer-Encoding: 8bit
- 修复当缩放率为200%时,任务栏翻页图标互相遮盖
Related #19588
---
data/applet.css | 4 ++
icons/kiran-tasklist-next-symbolic.svg | 2 +-
icons/kiran-tasklist-previous-symbolic.svg | 47 +++++++++++++++++-----
src/tasklist/tasklist-applet-widget.cpp | 24 ++---------
src/tasklist/tasklist-paging-button.cpp | 1 +
5 files changed, 48 insertions(+), 30 deletions(-)
diff --git a/data/applet.css b/data/applet.css
index e8dc027..d6052a6 100644
--- a/data/applet.css
+++ b/data/applet.css
@@ -132,6 +132,10 @@ button.kiran-tasklist-button {
-gtkmm__CustomObject_KiranTasklistAppButton-indicator-size: 4px;
}
+button.tasklist-arrow-button {
+ border: none;
+ border-radius: 0px;
+}
window.app-previewer button.window-thumbnail {
min-width: 200px;
diff --git a/icons/kiran-tasklist-next-symbolic.svg b/icons/kiran-tasklist-next-symbolic.svg
index 97ecca5..35cb5fb 100644
--- a/icons/kiran-tasklist-next-symbolic.svg
+++ b/icons/kiran-tasklist-next-symbolic.svg
@@ -35,5 +35,5 @@
}
</style>
</defs>
- <path id="icon_arrow" class="cls-1" d="M5831,327.994l8,8.122,8-8.122v1.889l-8,8.122-8-8.122v-1.889Z" transform="translate(-5831 -325)"/>
+ <path id="下箭头" class="cls-1" d="M2309,1231l-5,4.87-5-4.87v1.13l5,4.87,5-4.87V1231Z" transform="translate(-2296 -1226)"/>
</svg>
diff --git a/icons/kiran-tasklist-previous-symbolic.svg b/icons/kiran-tasklist-previous-symbolic.svg
index cd4501f..7242da8 100644
--- a/icons/kiran-tasklist-previous-symbolic.svg
+++ b/icons/kiran-tasklist-previous-symbolic.svg
@@ -1,10 +1,39 @@
-<?xml version="1.0" encoding="utf-8"?>
-<!-- Generator: Adobe Illustrator 22.1.0, SVG Export Plug-In . SVG Version: 6.00 Build 0) -->
-<svg version="1.1" id="图层_1" xmlns="http://www.w3.org/2000/svg" xmlns:xlink="http://www.w3.org/1999/xlink" x="0px" y="0px"
- viewBox="0 0 16 16" style="enable-background:new 0 0 16 16;" xml:space="preserve">
-<style type="text/css">
- .st0{fill:#FFFFFF;}
-</style>
-<path id="icon_arrow" class="st0" d="M0,11.1L8,3l8,8.1V13L8,4.9L0,13L0,11.1z"/>
-<path id="icon_arrow_1_" class="st0" d="M16,13L8,4.9L0,13l0-1.9L8,3l8,8.1V13z"/>
+<svg xmlns="http://www.w3.org/2000/svg" width="16" height="16" viewBox="0 0 16 16">
+ <metadata><?xpacket begin="" id="W5M0MpCehiHzreSzNTczkc9d"?>
+<x:xmpmeta xmlns:x="adobe:ns:meta/" x:xmptk="Adobe XMP Core 5.6-c138 79.159824, 2016/09/14-01:09:01 ">
+ <rdf:RDF xmlns:rdf="http://www.w3.org/1999/02/22-rdf-syntax-ns#">
+ <rdf:Description rdf:about=""/>
+ </rdf:RDF>
+</x:xmpmeta>
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+<?xpacket end="w"?></metadata>
+<defs>
+ <style>
+ .cls-1 {
+ fill: #fff;
+ fill-rule: evenodd;
+ }
+ </style>
+ </defs>
+ <path id="上箭头" class="cls-1" d="M2325,1237l-5-4.87-5,4.87v-1.13l5-4.87,5,4.87V1237Z" transform="translate(-2312 -1226)"/>
</svg>
diff --git a/src/tasklist/tasklist-applet-widget.cpp b/src/tasklist/tasklist-applet-widget.cpp
index 1601920..da61329 100644
--- a/src/tasklist/tasklist-applet-widget.cpp
+++ b/src/tasklist/tasklist-applet-widget.cpp
@@ -53,7 +53,7 @@ void on_applet_size_allocate(MatePanelApplet *applet UNUSED,
delete[] hints;
}
-TasklistAppletWidget::TasklistAppletWidget(MatePanelApplet *applet_) : button_box(Gtk::ORIENTATION_VERTICAL),
+TasklistAppletWidget::TasklistAppletWidget(MatePanelApplet *applet_) : button_box(Gtk::ORIENTATION_HORIZONTAL),
prev_btn(nullptr),
next_btn(nullptr),
container(applet_),
@@ -106,14 +106,9 @@ void TasklistAppletWidget::init_ui()
prev_btn = create_paging_button("kiran-tasklist-previous-symbolic", _("Previous"));
next_btn = create_paging_button("kiran-tasklist-next-symbolic", _("Next"));
- prev_btn->set_valign(Gtk::ALIGN_FILL);
- next_btn->set_valign(Gtk::ALIGN_FILL);
-
button_box.set_spacing(2);
button_box.set_margin_start(5);
button_box.set_margin_end(5);
- button_box.set_valign(Gtk::ALIGN_FILL);
- button_box.set_halign(Gtk::ALIGN_CENTER);
button_box.pack_start(*prev_btn, true, true);
button_box.pack_end(*next_btn, true, true);
@@ -125,13 +120,11 @@ void TasklistAppletWidget::init_ui()
{
if (get_orientation() == Gtk::ORIENTATION_HORIZONTAL)
{
- button_box.set_orientation(Gtk::ORIENTATION_VERTICAL);
- button_box.set_size_request(16, -1);
+ button_box.set_orientation(Gtk::ORIENTATION_HORIZONTAL);
}
else
{
- button_box.set_orientation(Gtk::ORIENTATION_HORIZONTAL);
- button_box.set_size_request(-1, 16);
+ button_box.set_orientation(Gtk::ORIENTATION_VERTICAL);
}
container.update_orientation();
@@ -150,16 +143,7 @@ Gtk::Button *TasklistAppletWidget::create_paging_button(const std::string &icon_
{
auto button = Gtk::make_managed<TasklistPagingButton>(applet);
- auto scale = Gdk::Window::get_default_root_window()->get_scale_factor();
- auto icon_info = Gtk::IconTheme::get_default()->lookup_icon(icon_name, 6, scale);
- auto style_context = Gtk::StyleContext::create();
- bool was_symbolic = true;
- auto pixbuf = icon_info.load_symbolic(style_context, was_symbolic);
-
- auto image = Gtk::make_managed<Gtk::Image>();
- image->set(pixbuf);
- button->set_image(*image);
- button->set_size_request(30, -1);
+ button->set_image_from_icon_name(icon_name, Gtk::ICON_SIZE_BUTTON);
button->set_tooltip_text(tooltip_text);
return button;
diff --git a/src/tasklist/tasklist-paging-button.cpp b/src/tasklist/tasklist-paging-button.cpp
index 7563029..2b2a27b 100644
--- a/src/tasklist/tasklist-paging-button.cpp
+++ b/src/tasklist/tasklist-paging-button.cpp
@@ -29,6 +29,7 @@ TasklistPagingButton::TasklistPagingButton(MatePanelApplet *applet_) : applet(ap
drag_dest_set(targets, Gtk::DEST_DEFAULT_ALL, Gdk::ACTION_MOVE);
get_style_context()->add_class("tasklist-arrow-button");
+ get_style_context()->add_class("flat");
}
// void TasklistPagingButton::set_icon_image(const Glib::ustring icon_resource_, int icon_size_)
--
2.27.0