Skip to content
Projects
Groups
Snippets
Help
This project
Loading...
Sign in / Register
Toggle navigation
Y
yad
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
Vladislav
yad
Commits
fffe12a4
Commit
fffe12a4
authored
Jan 19, 2021
by
Victor Ananjevsky
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
add --css option. park gtkrc as deprecated
parent
d087ec86
Hide whitespace changes
Inline
Side-by-side
Showing
3 changed files
with
23 additions
and
3 deletions
+23
-3
main.c
src/main.c
+18
-2
option.c
src/option.c
+4
-1
yad.h
src/yad.h
+1
-0
No files found.
src/main.c
View file @
fffe12a4
...
...
@@ -746,10 +746,26 @@ main (gint argc, gchar ** argv)
is_x11
=
TRUE
;
#endif
/* parse custom
gtkrc
*/
if
(
options
.
gtkrc_file
)
/* parse custom
css
*/
if
(
options
.
css
)
{
GtkCssProvider
*
css
=
gtk_css_provider_new
();
if
(
g_file_test
(
options
.
css
,
G_FILE_TEST_EXISTS
))
gtk_css_provider_load_from_path
(
css
,
options
.
css
,
NULL
);
else
gtk_css_provider_load_from_data
(
css
,
options
.
css
,
-
1
,
NULL
);
gtk_style_context_add_provider_for_screen
(
gdk_screen_get_default
(),
GTK_STYLE_PROVIDER
(
css
),
GTK_STYLE_PROVIDER_PRIORITY_USER
);
g_object_unref
(
css
);
}
else
if
(
options
.
gtkrc_file
)
{
GtkCssProvider
*
css
=
gtk_css_provider_new
();
if
(
options
.
debug
)
g_printerr
(
_
(
"WARNING: Using gtkrc option is deprecated, please use --css instead
\n
"
));
gtk_css_provider_load_from_path
(
css
,
options
.
gtkrc_file
,
NULL
);
gtk_style_context_add_provider_for_screen
(
gdk_screen_get_default
(),
GTK_STYLE_PROVIDER
(
css
),
GTK_STYLE_PROVIDER_PRIORITY_USER
);
...
...
src/option.c
View file @
fffe12a4
...
...
@@ -660,8 +660,10 @@ static GOptionEntry misc_options[] = {
{
"show-themes"
,
0
,
0
,
G_OPTION_ARG_NONE
,
&
themes_mode
,
N_
(
"Show list of GtkSourceView themes"
),
NULL
},
#endif
{
"css"
,
0
,
0
,
G_OPTION_ARG_STRING
,
&
options
.
css
,
N_
(
"Load additional CSS settings from file or string"
),
N_
(
"STRING"
)
},
{
"gtkrc"
,
0
,
0
,
G_OPTION_ARG_FILENAME
,
&
options
.
gtkrc_file
,
N_
(
"Load additional
GTK
settings from file"
),
N_
(
"FILENAME"
)
},
N_
(
"Load additional
CSS
settings from file"
),
N_
(
"FILENAME"
)
},
{
"hscroll-policy"
,
0
,
0
,
G_OPTION_ARG_CALLBACK
,
set_scroll_policy
,
N_
(
"Set policy for horizontal scrollbars (auto, always, never)"
),
N_
(
"TYPE"
)
},
{
"vscroll-policy"
,
0
,
0
,
G_OPTION_ARG_CALLBACK
,
set_scroll_policy
,
...
...
@@ -1465,6 +1467,7 @@ yad_options_init (void)
options
.
mode
=
YAD_MODE_MESSAGE
;
options
.
rest_file
=
NULL
;
options
.
extra_data
=
NULL
;
options
.
css
=
NULL
;
options
.
gtkrc_file
=
NULL
;
#ifndef G_OS_WIN32
options
.
kill_parent
=
0
;
...
...
src/yad.h
View file @
fffe12a4
...
...
@@ -525,6 +525,7 @@ typedef struct {
YadSourceData
source_data
;
#endif
gchar
*
css
;
gchar
*
gtkrc_file
;
GtkPolicyType
hscroll_policy
;
...
...
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