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
4b54d144
You need to sign in or sign up before continuing.
Commit
4b54d144
authored
Feb 08, 2020
by
Victor Ananjevsky
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
add customizable options for text dialog (with using css)
parent
04318ff1
Expand all
Hide whitespace changes
Inline
Side-by-side
Showing
6 changed files
with
40 additions
and
1 deletion
+40
-1
yad.1
data/yad.1
+8
-1
ru.po
po/ru.po
+0
-0
uk.po
po/uk.po
+0
-0
option.c
src/option.c
+6
-0
text.c
src/text.c
+24
-0
yad.h
src/yad.h
+2
-0
No files found.
data/yad.1
View file @
4b54d144
...
...
@@ -881,7 +881,13 @@ Show cursor in read-only mode.
.B \-\-show-uri
Make links in text clickable. Links opens with \fIxdg-open\fP command.
.TP
.B \-\-uri-color
.B \-\-fore=\fICOLOR\fP
Set default color for text.
.TP
.B \-\-back=\fICOLOR\fP
Set default color for background.
.TP
.B \-\-uri-color=\fICOLOR\fP
Set color for links. Default is \fIblue\fP.
.TP
.B \-\-lang=LANGUAGE
...
...
@@ -893,6 +899,7 @@ Set used theme to \fITHEME\fP. This option works only if yad builds with gtksour
.B \-\-listen
Listen data from stdin even if filename was specified.
If \fIfontname\fP option is specified for text dialog, the description of font must be in CSS style (not in a Pango style).
Sending FormFeed character to text dialog clears it. This symbol may be sent as \fIecho \-e '\\f'\fP.
Pressing \fICtrl+S\fP popups the search entry in text dialog.
...
...
po/ru.po
View file @
4b54d144
This diff is collapsed.
Click to expand it.
po/uk.po
View file @
4b54d144
This diff is collapsed.
Click to expand it.
src/option.c
View file @
4b54d144
...
...
@@ -601,6 +601,10 @@ static GOptionEntry text_options[] = {
N_
(
"Set justification (left, right, center or fill)"
),
N_
(
"TYPE"
)
},
{
"margins"
,
0
,
0
,
G_OPTION_ARG_INT
,
&
options
.
text_data
.
margins
,
N_
(
"Set text margins"
),
N_
(
"SIZE"
)
},
{
"fore"
,
0
,
0
,
G_OPTION_ARG_STRING
,
&
options
.
text_data
.
fore
,
N_
(
"Use specified color for text"
),
N_
(
"COLOR"
)
},
{
"back"
,
0
,
0
,
G_OPTION_ARG_STRING
,
&
options
.
text_data
.
back
,
N_
(
"Use specified color for background"
),
N_
(
"COLOR"
)
},
{
"show-cursor"
,
0
,
G_OPTION_FLAG_REVERSE
,
G_OPTION_ARG_NONE
,
&
options
.
text_data
.
hide_cursor
,
N_
(
"Show cursor in read-only mode"
),
NULL
},
{
"show-uri"
,
0
,
0
,
G_OPTION_ARG_NONE
,
&
options
.
text_data
.
uri
,
...
...
@@ -1707,6 +1711,8 @@ yad_options_init (void)
options
.
text_data
.
justify
=
GTK_JUSTIFY_LEFT
;
options
.
text_data
.
margins
=
0
;
options
.
text_data
.
hide_cursor
=
TRUE
;
options
.
text_data
.
fore
=
NULL
;
options
.
text_data
.
back
=
NULL
;
#ifndef STANDALONE
options
.
text_data
.
uri_color
=
g_settings_get_string
(
settings
,
"uri-color"
);
#else
...
...
src/text.c
View file @
4b54d144
...
...
@@ -449,6 +449,30 @@ text_create_widget (GtkWidget * dlg)
if
(
options
.
text_data
.
wrap
)
gtk_text_view_set_wrap_mode
(
GTK_TEXT_VIEW
(
text_view
),
GTK_WRAP_WORD_CHAR
);
if
(
options
.
common_data
.
font
||
options
.
text_data
.
fore
||
options
.
text_data
.
back
)
{
GtkCssProvider
*
provider
;
GtkStyleContext
*
context
;
GString
*
css
;
css
=
g_string_new
(
"textview, textview text {
\n
"
);
if
(
options
.
common_data
.
font
)
g_string_append_printf
(
css
,
" font: %s;
\n
"
,
options
.
common_data
.
font
);
if
(
options
.
text_data
.
fore
)
g_string_append_printf
(
css
,
" color: %s;
\n
"
,
options
.
text_data
.
fore
);
if
(
options
.
text_data
.
back
)
g_string_append_printf
(
css
,
" background-color: %s;
\n
"
,
options
.
text_data
.
back
);
g_string_append
(
css
,
"}
\n
"
);
provider
=
gtk_css_provider_new
();
gtk_css_provider_load_from_data
(
provider
,
css
->
str
,
-
1
,
NULL
);
context
=
gtk_widget_get_style_context
(
text_view
);
gtk_style_context_add_provider
(
context
,
GTK_STYLE_PROVIDER
(
provider
),
GTK_STYLE_PROVIDER_PRIORITY_APPLICATION
);
g_string_free
(
css
,
TRUE
);
}
#ifdef HAVE_SOURCEVIEW
if
(
options
.
source_data
.
theme
)
{
...
...
src/yad.h
View file @
4b54d144
...
...
@@ -439,6 +439,8 @@ typedef struct {
gboolean
hide_cursor
;
gchar
*
uri_color
;
gboolean
formatted
;
gchar
*
fore
;
gchar
*
back
;
}
YadTextData
;
#ifdef HAVE_SOURCEVIEW
...
...
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