From b724b0e9b95db57f4489c996d0b3d8fc82dbe213 Mon Sep 17 00:00:00 2001 From: yutent Date: Fri, 18 Aug 2023 00:09:43 +0800 Subject: [PATCH] =?UTF-8?q?=E6=9B=B4=E6=96=B0?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- main.py | 1 + ui/image_button.py | 11 ++++++++--- usr/share/sonist/info.png | Bin 0 -> 1070 bytes usr/share/sonist/menu.png | Bin 0 -> 504 bytes usr/share/sonist/pin.png | Bin 0 -> 1030 bytes usr/share/sonist/setting.png | Bin 0 -> 1220 bytes usr/share/sonist/switch.png | Bin 0 -> 1004 bytes window.py | 4 ++++ 8 files changed, 13 insertions(+), 3 deletions(-) create mode 100644 usr/share/sonist/info.png create mode 100644 usr/share/sonist/menu.png create mode 100644 usr/share/sonist/pin.png create mode 100644 usr/share/sonist/setting.png create mode 100644 usr/share/sonist/switch.png diff --git a/main.py b/main.py index 54143b4..1859506 100755 --- a/main.py +++ b/main.py @@ -17,6 +17,7 @@ from mpd.base import MPDClient app_id = 'fun.wkit.sonist' + class Application(Gtk.Application): def __init__(self): Gtk.Application.__init__(self, application_id = app_id) diff --git a/ui/image_button.py b/ui/image_button.py index 7645b05..ff04074 100644 --- a/ui/image_button.py +++ b/ui/image_button.py @@ -2,7 +2,7 @@ import gi gi.require_version('Gtk', '3.0') -from gi.repository import Gtk +from gi.repository import Gtk, Gdk from .image import ScaleImage @@ -16,17 +16,22 @@ class ImageButton(Gtk.Button): image = ScaleImage(filepath) image.resize(width, height) + # 针对macos的设置, 但只解决了普通状态下的边框问题, 鼠标经过的样式还在 + self.set_relief(Gtk.ReliefStyle.NONE) + self.set_image(image) css_provider = Gtk.CssProvider() style = f""" - #ImageButton {{ + #ImageButton, #ImageButton:hover {{ border: 0; background-color: transparent; - outline: none; + border-color:transparent; + outline: transparent; }} """ css_provider.load_from_data(style.encode('UTF-8')) context = self.get_style_context() + path = context.get_path() context.add_provider(css_provider, Gtk.STYLE_PROVIDER_PRIORITY_USER) diff --git a/usr/share/sonist/info.png b/usr/share/sonist/info.png new file mode 100644 index 0000000000000000000000000000000000000000..63d2fdd0597badcf94f02a6c42107200af860406 GIT binary patch literal 1070 zcmV+}1kwA6P)Px&=t)FDRCr$PoMCd@APj|_!}uI+PS)mRP0zt$+R+Zou&h8&Aj!!t{*z>v82EU4 z$k_Pp*vF8-+vYPSumK4Q*?_(}pp??js*UyUpY-{8p0}S@9ia-!FbKkr<2Y&T%)!c;NH3^V|>G)Pl`1iyLL`U?U8DKmgHJz%qdIOR+?0_nV_Oh?(2 zV7_b4LuJ)~I-@jIdEMA1pt=g#q)TwkS#tWpB(!XYOmqXQ}y)Yn)$_CRm zZ3UjQ1Nht!pe%o?s6Lj%s!|VS%kBB$PDsAe@gzv0D4>TCKF<^SU#amGq`D3>_;mi2 z0Tw&y8Co1X>WoL4(19eX2m#c_u$lBxby<~TLQPca5D=#x>(H|5JaV2H6-j{FsrTEe zr{i_>@lZuwK+mS0CMkt;E)5`e^^|1{>qW0N{4`!P0t8b=;$JG$C{{F2>3pN_887PA z#{%Na%-fvXkPfJ?ot@b!zXzyI3?stpuE7@oV*A(w6rTIEz7PPYy}V(=tOw}Mf4m!; zF9$*ulD8 zecgcWmwF#^p;z~yDFs0Zl;sR|p$D~qAd`M2Kzfr#Gt4JZ&;}$ddrV(yh-AOJg3v1l zbh*QI0qY8rW|ovy%N^lHeZg`Ew4^gyat#f$NI;quQw<>3Fbf7GCWysjM}Qt4DDYf@ z2nGb-?~`sELUC#_qeTJI-tUtDagU{lH~eRS1pUCg8~XsQ4k=t zWrzymlDHf~rlA%Ds2*(SULOjGQ;}(?MF6Uv@PHrEf&gU|aSvLWL5c*VnM7bf14xim zrA9pkpn)GPLu$5bn(Yjd21fc`rJyQ?*{ujOkNQguy!!iDKxEqV;5WA$a9K@PL#gYZ z0#qr9Gj94i9Fo`L!%Kh$#$6b?gJQB{)BJ215CG|>D9e4M!hSWg)C0QIK>YyRM_ORf z8x>UBxD_uYFjcLIf@+9a@|rg*l-{*%nT}BU{5=HuRYT0t_4#C0fn}OsU)r zPy>qol=i!$KuS4RFkyh2@S{*!dAUhRAyh9V(2_UHgH|f86juD@;ng^$jK}sUwC(O8 ohBoA@mfL`Yk=cMYpta!r4~y8m_5Z#Aj7kPi LS3j3^P6Px&z)3_wRCr$Po9%JrAPk0`VqC{1mEEPXBy~_sZnR@Egw-cVM!RGG*&mB-^zcdu zfnT=kVhOxle0TyEAVDD)pl1P8O8Ix#@(I8DzTbYMuha@ErMzz2_IKMh`0XzM^d1c= zEucd&07tq2QdO7K*8G1;K!zTirz?rufRaF)1d0(9gmwUDk!M>K81T*{gPU`eSOkfDgKfl}Knfz!BKzpT0I zj|xyJ1xw;AAo{jT!8Cw+yX=4jI1phqLmlPxhF>9xz+fU52Xqq7bf-T)XcS-AB6EiJo zlQ@f&Qm|dlRFDR?s#_tmwrBuhDuNfJfTUDSyJh_|^J->P5fG4=DHlY>96>pdRzTpL zI!B}elo1jG$MxKh8c;S!L;~wtXak!~fU-cctj1?u+zeP63acdz z16lz|bGS-Ug!TU^Kxacj)Z-qMdw|n`7)Y*(B%z)#*Q%hr0EMsmz4q<1xR|^2SGd{f4hYd6b4MtVM-G>HgVqsaIb6S9mFxdJ`3eZCxoU$5iX)onL z@T}KW^0pWf)z(}vi|R<$=U#w>k+}d}faaX{KlV+xXBDU4fB*mh07*qoM6N<$f`%s0 AvH$=8 literal 0 HcmV?d00001 diff --git a/usr/share/sonist/setting.png b/usr/share/sonist/setting.png new file mode 100644 index 0000000000000000000000000000000000000000..bacfdf07c466b95c9bad2fcf88c009ca5c11e172 GIT binary patch literal 1220 zcmV;#1UvhQP)Px(en~_@RCr$PoLy4fFbsgrVRDYb$y!cUIEN2IN7QBfVEIo2$um2%9`LiGkk4zN&pFPekM8;24y*=w7JgjPgWw_ zJM7BqL{fl;(hwK$hh0I3yHLQqa?>uC1@z^CvyOFG6e#&=iC5f$9mf&YGkhU2nXpOE zyau@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