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
2e04355a
Commit
2e04355a
authored
Nov 27, 2020
by
Victor Ananjevsky
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
add --text-width option
parent
07059691
Expand all
Hide whitespace changes
Inline
Side-by-side
Showing
6 changed files
with
16 additions
and
6 deletions
+16
-6
yad.1
data/yad.1
+3
-0
ru.po
po/ru.po
+0
-0
uk.po
po/uk.po
+0
-0
main.c
src/main.c
+9
-6
option.c
src/option.c
+3
-0
yad.h
src/yad.h
+1
-0
No files found.
data/yad.1
View file @
2e04355a
...
...
@@ -123,6 +123,9 @@ Set the tab number for plugged dialog. See \fINOTEBOOK\fP section for more.
.B \-\-text=\fISTRING\fP
Set the dialog text.
.TP
.B \-\-text-width=\fINUMBER\fP
Set the maximum dialog text width in characters.
.TP
.B \-\-text-align=\fITYPE\fP
Set type of dialog text justification. \fITYPE\fP may be \fIleft\fP, \fIright\fP, \fIcenter\fP or \fIfill\fP.
.TP
...
...
po/ru.po
View file @
2e04355a
This diff is collapsed.
Click to expand it.
po/uk.po
View file @
2e04355a
This diff is collapsed.
Click to expand it.
src/main.c
View file @
2e04355a
...
...
@@ -195,12 +195,6 @@ create_layout (GtkWidget *dlg)
gchar
*
buf
=
g_strcompress
(
options
.
data
.
dialog_text
);
text
=
gtk_label_new
(
NULL
);
if
(
!
options
.
data
.
no_markup
)
gtk_label_set_markup
(
GTK_LABEL
(
text
),
buf
);
else
gtk_label_set_text
(
GTK_LABEL
(
text
),
buf
);
g_free
(
buf
);
gtk_widget_set_name
(
text
,
"yad-dialog-label"
);
gtk_label_set_line_wrap
(
GTK_LABEL
(
text
),
TRUE
);
gtk_label_set_selectable
(
GTK_LABEL
(
text
),
options
.
data
.
selectable_labels
);
...
...
@@ -208,6 +202,15 @@ create_layout (GtkWidget *dlg)
gtk_widget_set_state_flags
(
text
,
GTK_STATE_FLAG_NORMAL
,
FALSE
);
gtk_label_set_xalign
(
GTK_LABEL
(
text
),
options
.
data
.
text_align
);
gtk_widget_set_can_focus
(
text
,
FALSE
);
if
(
options
.
data
.
text_width
>
0
)
gtk_label_set_max_width_chars
(
GTK_LABEL
(
text
),
options
.
data
.
text_width
);
if
(
!
options
.
data
.
no_markup
)
gtk_label_set_markup
(
GTK_LABEL
(
text
),
buf
);
else
gtk_label_set_text
(
GTK_LABEL
(
text
),
buf
);
g_free
(
buf
);
}
}
...
...
src/option.c
View file @
2e04355a
...
...
@@ -112,6 +112,8 @@ static GOptionEntry general_options[] = {
N_
(
"Show remaining time indicator (top, bottom, left, right)"
),
N_
(
"POS"
)
},
{
"text"
,
0
,
G_OPTION_FLAG_NOALIAS
,
G_OPTION_ARG_STRING
,
&
options
.
data
.
dialog_text
,
N_
(
"Set the dialog text"
),
N_
(
"TEXT"
)
},
{
"text-width"
,
0
,
G_OPTION_FLAG_NOALIAS
,
G_OPTION_ARG_INT
,
&
options
.
data
.
text_width
,
N_
(
"Set the dialog text width in characters"
),
N_
(
"NUMBER"
)
},
{
"text-align"
,
0
,
G_OPTION_FLAG_NOALIAS
,
G_OPTION_ARG_CALLBACK
,
set_text_align
,
N_
(
"Set the dialog text alignment (left, center, right, fill)"
),
N_
(
"TYPE"
)
},
{
"image"
,
0
,
G_OPTION_FLAG_NOALIAS
,
G_OPTION_ARG_FILENAME
,
&
options
.
data
.
dialog_image
,
...
...
@@ -1508,6 +1510,7 @@ yad_options_init (void)
options
.
data
.
posy
=
0
;
options
.
data
.
geometry
=
NULL
;
options
.
data
.
dialog_text
=
NULL
;
options
.
data
.
text_width
=
0
;
options
.
data
.
text_align
=
GTK_JUSTIFY_LEFT
;
options
.
data
.
dialog_image
=
NULL
;
options
.
data
.
icon_theme
=
NULL
;
...
...
src/yad.h
View file @
2e04355a
...
...
@@ -221,6 +221,7 @@ typedef struct {
guint
timeout
;
gchar
*
to_indicator
;
gchar
*
dialog_text
;
guint
text_width
;
gdouble
text_align
;
gchar
*
dialog_image
;
gchar
*
icon_theme
;
...
...
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