Skip to content
Projects
Groups
Snippets
Help
This project
Loading...
Sign in / Register
Toggle navigation
X
ximper-shell-notification-center
Project
Project
Details
Activity
Cycle Analytics
Repository
Repository
Files
Commits
Branches
Tags
Contributors
Graph
Compare
Charts
Issues
0
Issues
0
List
Board
Labels
Milestones
Merge Requests
0
Merge Requests
0
CI / CD
CI / CD
Pipelines
Jobs
Schedules
Charts
Registry
Registry
Wiki
Wiki
Snippets
Snippets
Members
Members
Collapse sidebar
Close sidebar
Activity
Graph
Charts
Create a new issue
Jobs
Commits
Issue Boards
Open sidebar
Ximper Linux
ximper-shell-notification-center
Commits
e400600d
Commit
e400600d
authored
Jul 06, 2023
by
Erik Reider
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
Be more verbose when loading CSS and config
parent
181d43b6
Hide whitespace changes
Inline
Side-by-side
Showing
2 changed files
with
15 additions
and
9 deletions
+15
-9
configModel.vala
src/configModel/configModel.vala
+3
-1
functions.vala
src/functions.vala
+12
-8
No files found.
src/configModel/configModel.vala
View file @
e400600d
...
...
@@ -311,6 +311,8 @@ namespace SwayNotificationCenter {
public
static
void
reload_config
(
ModifyNode
modify_cb
=
()
=>
{})
{
// Re-check if config file path still exists
string
path
=
Functions
.
get_config_path
(
_path
);
path
=
File
.
new_for_path
(
path
).
get_path
()
??
path
;
message
(
"Loading Config: \"%s\""
,
path
);
ConfigModel
m
=
null
;
try
{
...
...
@@ -331,7 +333,7 @@ namespace SwayNotificationCenter {
}
m
=
model
;
}
catch
(
Error
e
)
{
stderr
.
printf
(
e
.
message
+
"\n"
);
critical
(
e
.
message
);
}
_instance
=
m
??
new
ConfigModel
();
_path
=
path
;
...
...
src/functions.vala
View file @
e400600d
...
...
@@ -72,32 +72,36 @@ namespace SwayNotificationCenter {
public
static
bool
load_css
(
string
?
style_path
)
{
int
css_priority
=
ConfigModel
.
instance
.
cssPriority
.
get_priority
();
// Load packaged CSS as backup
string
system_css
=
get_style_path
(
null
,
true
);
system_css
=
File
.
new_for_path
(
system_css
).
get_path
()
??
system_css
;
message
(
"Loading CSS: \"%s\""
,
system_css
);
try
{
// Load packaged CSS as backup
string
system_css
=
get_style_path
(
null
,
true
);
system_css_provider
.
load_from_path
(
system_css
);
Gtk
.
StyleContext
.
add_provider_for_screen
(
Gdk
.
Screen
.
get_default
(),
system_css_provider
,
css_priority
);
}
catch
(
Error
e
)
{
print
(
"Load packaged CSS Error: %s\n"
,
e
.
message
);
return
false
;
critical
(
"Load packaged CSS Error (\"%s\"):\n\t%s\n"
,
system_css
,
e
.
message
);
}
// Load user CSS
string
user_css
=
get_style_path
(
style_path
);
user_css
=
File
.
new_for_path
(
user_css
).
get_path
()
??
user_css
;
message
(
"Loading CSS: \"%s\""
,
user_css
);
try
{
// Load user CSS
string
user_css
=
get_style_path
(
style_path
);
user_css_provider
.
load_from_path
(
user_css
);
Gtk
.
StyleContext
.
add_provider_for_screen
(
Gdk
.
Screen
.
get_default
(),
user_css_provider
,
css_priority
);
return
true
;
}
catch
(
Error
e
)
{
print
(
"Load user CSS Error: %s\n"
,
e
.
message
);
critical
(
"Load user CSS Error (\"%s\"):\n\t%s\n"
,
user_css
,
e
.
message
);
return
false
;
}
return
true
;
}
public
static
string
get_style_path
(
owned
string
?
custom_path
,
...
...
Write
Preview
Markdown
is supported
0%
Try again
or
attach a new file
Attach a file
Cancel
You are about to add
0
people
to the discussion. Proceed with caution.
Finish editing this message first!
Cancel
Please
register
or
sign in
to comment