Add style for finder

This commit is contained in:
daleclack 2022-01-27 15:25:47 +08:00
parent 30a1399689
commit 0d61f0a47e
8 changed files with 44 additions and 4 deletions

View File

@ -35,6 +35,8 @@ set(RESOURCE_LIST
menubar.xml
mainmenu.xml
stack.ui
style.css
reset.css
icons/16x16/actions/My_GtkUI.png
icons/48x48/actions/My_GtkUI.png)

View File

@ -12,6 +12,11 @@
</item>
<item>
<attribute name="label">Change Background</attribute>
<attribute name="action">win.back</attribute>
</item>
<item>
<attribute name="label">Refresh</attribute>
<attribute name="action">win.refresh</attribute>
</item>
</section>
<section>

View File

@ -305,12 +305,12 @@
<attribute name="label">Network</attribute>
</item>
<submenu>
<attribute name="label">iDisk</attribute>
<attribute name="label">iCloud</attribute>
<item>
<attribute name="label">My iDisk</attribute>
<attribute name="label">My iCloud</attribute>
</item>
<item>
<attribute name="label">Other User's iDisk</attribute>
<attribute name="label">Other User's iCloud</attribute>
</item>
<item>
<attribute name="label">Other User's Public Folder</attribute>

12
Gtkmm3_Mac/res/reset.css Normal file
View File

@ -0,0 +1,12 @@
/* @import this colorsheet to get the default values for every property.
* This is useful when writing special CSS tests that should not be
* inluenced by themes - not even the default ones.
* Keep in mind that the output will be very ugly and not look like
* anything GTK.
* Also, when adding new style properties, please add them here.
*/
* {
all: unset;
}

12
Gtkmm3_Mac/res/style.css Normal file
View File

@ -0,0 +1,12 @@
/*
您可以在这里输入任何 GTK+ 可识别的 CSS 规则
您可以点击上面的暂停按钮来暂时停用这个自定义 CSS
变更会立即应用到全局影响整个应用程序
*/
@import url("resource://org/gtk/daleclack/reset.css");
box{
background-color:alpha(white,0.7);
}

View File

@ -1,6 +1,5 @@
#include "MyWin.hh"
#include "winpe.xpm"
#include <iostream>
MyWin::MyWin()
:menubox(Gtk::ORIENTATION_HORIZONTAL,0)

View File

@ -74,6 +74,12 @@ MyFinder::MyFinder()
pack_end(timer_button, Gtk::PACK_SHRINK);
mytimer = Glib::signal_timeout().connect(sigc::mem_fun(*this, &MyFinder::time_out), 1000);
//Add Style for MyFinder
provider = Gtk::CssProvider::create();
provider->load_from_resource("/org/gtk/daleclack/style.css");
auto style = get_style_context();
style->add_provider(provider,G_MAXUINT);
}
bool MyFinder::time_out()

View File

@ -14,10 +14,14 @@ private:
Gtk::MenuButton timer_button;
Gtk::Popover time_popover;
Gtk::Calendar calender;
Gtk::VolumeButton btn_vol;
// Get Menu
Glib::RefPtr<Gio::Menu> get_menu(Glib::RefPtr<Gtk::Builder> &builder, const Glib::ustring &id);
//Style for finder
Glib::RefPtr<Gtk::CssProvider> provider;
//Timer
sigc::connection mytimer;
bool time_out();