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
86bfc4c9
Commit
86bfc4c9
authored
Apr 23, 2018
by
Victor Ananjesky
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
add --expand option to a notebook dialog
parent
d853b074
Expand all
Show whitespace changes
Inline
Side-by-side
Showing
7 changed files
with
22 additions
and
10 deletions
+22
-10
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
+14
-10
notebook.c
src/notebook.c
+1
-0
option.c
src/option.c
+3
-0
yad.h
src/yad.h
+1
-0
No files found.
data/yad.1
View file @
86bfc4c9
...
@@ -712,6 +712,9 @@ Set the borders width around widget in tabs.
...
@@ -712,6 +712,9 @@ Set the borders width around widget in tabs.
.TP
.TP
.B \-\-active-tab=\fINUMBER\fP
.B \-\-active-tab=\fINUMBER\fP
Set active tab.
Set active tab.
.TP
.B \-\-expand
Expand all tabs to full width of a dialog window.
.PP
.PP
See \fBNOTEBOOK and PANED\fP section for more about notebook dialog.
See \fBNOTEBOOK and PANED\fP section for more about notebook dialog.
...
...
po/ru.po
View file @
86bfc4c9
This diff is collapsed.
Click to expand it.
po/uk.po
View file @
86bfc4c9
This diff is collapsed.
Click to expand it.
src/main.c
View file @
86bfc4c9
...
@@ -218,12 +218,13 @@ create_layout (GtkWidget *dlg)
...
@@ -218,12 +218,13 @@ create_layout (GtkWidget *dlg)
gtk_label_set_line_wrap
(
GTK_LABEL
(
text
),
TRUE
);
gtk_label_set_line_wrap
(
GTK_LABEL
(
text
),
TRUE
);
gtk_label_set_selectable
(
GTK_LABEL
(
text
),
options
.
data
.
selectable_labels
);
gtk_label_set_selectable
(
GTK_LABEL
(
text
),
options
.
data
.
selectable_labels
);
gtk_label_set_justify
(
GTK_LABEL
(
text
),
options
.
data
.
text_align
);
gtk_label_set_justify
(
GTK_LABEL
(
text
),
options
.
data
.
text_align
);
gtk_widget_set_state
(
text
,
GTK_STATE_NORMAL
);
#if !GTK_CHECK_VERSION(3,0,0)
#if !GTK_CHECK_VERSION(3,0,0)
gtk_widget_set_state
(
text
,
GTK_STATE_NORMAL
);
gtk_misc_set_alignment
(
GTK_MISC
(
text
),
options
.
data
.
text_align
,
0
.
5
);
gtk_misc_set_alignment
(
GTK_MISC
(
text
),
options
.
data
.
text_align
,
0
.
5
);
if
(
!
options
.
data
.
fixed
)
if
(
!
options
.
data
.
fixed
)
g_signal_connect
(
G_OBJECT
(
text
),
"size-allocate"
,
G_CALLBACK
(
text_size_allocate_cb
),
NULL
);
g_signal_connect
(
G_OBJECT
(
text
),
"size-allocate"
,
G_CALLBACK
(
text_size_allocate_cb
),
NULL
);
#else
#else
gtk_widget_set_state_flags
(
text
,
GTK_STATE_NORMAL
,
FALSE
);
gtk_label_set_xalign
(
GTK_LABEL
(
text
),
options
.
data
.
text_align
);
gtk_label_set_xalign
(
GTK_LABEL
(
text
),
options
.
data
.
text_align
);
#endif
#endif
}
}
...
@@ -359,6 +360,7 @@ create_dialog (void)
...
@@ -359,6 +360,7 @@ create_dialog (void)
gtk_window_set_type_hint
(
GTK_WINDOW
(
dlg
),
GDK_WINDOW_TYPE_HINT_SPLASHSCREEN
);
gtk_window_set_type_hint
(
GTK_WINDOW
(
dlg
),
GDK_WINDOW_TYPE_HINT_SPLASHSCREEN
);
gtk_window_set_title
(
GTK_WINDOW
(
dlg
),
options
.
data
.
dialog_title
);
gtk_window_set_title
(
GTK_WINDOW
(
dlg
),
options
.
data
.
dialog_title
);
gtk_widget_set_name
(
dlg
,
"yad-dialog-window"
);
gtk_widget_set_name
(
dlg
,
"yad-dialog-window"
);
gtk_window_set_default_size
(
GTK_WINDOW
(
dlg
),
options
.
data
.
width
,
options
.
data
.
height
);
g_signal_connect
(
G_OBJECT
(
dlg
),
"delete-event"
,
G_CALLBACK
(
gtk_main_quit
),
NULL
);
g_signal_connect
(
G_OBJECT
(
dlg
),
"delete-event"
,
G_CALLBACK
(
gtk_main_quit
),
NULL
);
g_signal_connect
(
G_OBJECT
(
dlg
),
"key-press-event"
,
G_CALLBACK
(
keys_cb
),
NULL
);
g_signal_connect
(
G_OBJECT
(
dlg
),
"key-press-event"
,
G_CALLBACK
(
keys_cb
),
NULL
);
...
@@ -381,7 +383,6 @@ create_dialog (void)
...
@@ -381,7 +383,6 @@ create_dialog (void)
/* set window size and position */
/* set window size and position */
if
(
!
options
.
data
.
geometry
&&
!
options
.
data
.
maximized
&&
!
options
.
data
.
fullscreen
)
if
(
!
options
.
data
.
geometry
&&
!
options
.
data
.
maximized
&&
!
options
.
data
.
fullscreen
)
{
{
gtk_window_set_default_size
(
GTK_WINDOW
(
dlg
),
options
.
data
.
width
,
options
.
data
.
height
);
if
(
options
.
data
.
center
)
if
(
options
.
data
.
center
)
gtk_window_set_position
(
GTK_WINDOW
(
dlg
),
GTK_WIN_POS_CENTER_ALWAYS
);
gtk_window_set_position
(
GTK_WINDOW
(
dlg
),
GTK_WIN_POS_CENTER_ALWAYS
);
else
if
(
options
.
data
.
mouse
)
else
if
(
options
.
data
.
mouse
)
...
@@ -593,15 +594,23 @@ create_dialog (void)
...
@@ -593,15 +594,23 @@ create_dialog (void)
/* parse geometry or move window, if given. must be after showing widget */
/* parse geometry or move window, if given. must be after showing widget */
if
(
!
options
.
data
.
maximized
&&
!
options
.
data
.
fullscreen
)
if
(
!
options
.
data
.
maximized
&&
!
options
.
data
.
fullscreen
)
{
{
gtk_widget_realize
(
dlg
);
if
(
options
.
data
.
geometry
)
if
(
options
.
data
.
geometry
)
{
{
gtk_widget_realize
(
dlg
);
gtk_window_parse_geometry
(
GTK_WINDOW
(
dlg
),
options
.
data
.
geometry
);
gtk_window_parse_geometry
(
GTK_WINDOW
(
dlg
),
options
.
data
.
geometry
);
gtk_widget_show
(
dlg
);
gtk_widget_show
(
dlg
);
}
}
else
else
{
{
gtk_widget_show
(
dlg
);
/* if (options.data.width <= 0) */
/* options.data.width = gdk_window_get_width (gtk_widget_get_window (dlg)); */
/* if (options.data.height <= 0) */
/* options.data.height = gdk_window_get_height (gtk_widget_get_window (dlg)); */
/* gtk_window_resize (GTK_WINDOW (dlg), options.data.width, options.data.height); */
gtk_widget_set_size_request
(
dlg
,
options
.
data
.
width
,
options
.
data
.
height
);
gtk_window_set_resizable
(
GTK_WINDOW
(
dlg
),
!
options
.
data
.
fixed
);
gtk_widget_show_all
(
dlg
);
if
(
options
.
data
.
use_posx
||
options
.
data
.
use_posy
)
if
(
options
.
data
.
use_posx
||
options
.
data
.
use_posy
)
{
{
gint
ww
,
wh
;
gint
ww
,
wh
;
...
@@ -626,18 +635,13 @@ create_dialog (void)
...
@@ -626,18 +635,13 @@ create_dialog (void)
}
}
}
}
else
else
{
gtk_widget_show
(
dlg
);
gtk_widget_show
(
dlg
);
/* set maximized or fixed size after showing widget */
/* set maximized or fixed size after showing widget */
if
(
options
.
data
.
maximized
)
if
(
options
.
data
.
maximized
)
gtk_window_maximize
(
GTK_WINDOW
(
dlg
));
gtk_window_maximize
(
GTK_WINDOW
(
dlg
));
else
if
(
options
.
data
.
fullscreen
)
else
if
(
options
.
data
.
fullscreen
)
gtk_window_fullscreen
(
GTK_WINDOW
(
dlg
));
gtk_window_fullscreen
(
GTK_WINDOW
(
dlg
));
else
{
gtk_window_set_resizable
(
GTK_WINDOW
(
dlg
),
!
options
.
data
.
fixed
);
if
(
options
.
data
.
fixed
)
gtk_widget_set_size_request
(
dlg
,
options
.
data
.
width
,
options
.
data
.
height
);
}
}
#ifndef G_OS_WIN32
#ifndef G_OS_WIN32
...
...
src/notebook.c
View file @
86bfc4c9
...
@@ -67,6 +67,7 @@ notebook_create_widget (GtkWidget * dlg)
...
@@ -67,6 +67,7 @@ notebook_create_widget (GtkWidget * dlg)
g_object_set_data
(
G_OBJECT
(
a
),
"socket"
,
s
);
g_object_set_data
(
G_OBJECT
(
a
),
"socket"
,
s
);
gtk_notebook_append_page
(
GTK_NOTEBOOK
(
w
),
a
,
get_label
((
gchar
*
)
tab
->
data
,
0
));
gtk_notebook_append_page
(
GTK_NOTEBOOK
(
w
),
a
,
get_label
((
gchar
*
)
tab
->
data
,
0
));
gtk_container_child_set
(
GTK_CONTAINER
(
w
),
a
,
"tab-expand"
,
options
.
notebook_data
.
expand
,
NULL
);
}
}
/* set active tab */
/* set active tab */
...
...
src/option.c
View file @
86bfc4c9
...
@@ -485,6 +485,8 @@ static GOptionEntry notebook_options[] = {
...
@@ -485,6 +485,8 @@ static GOptionEntry notebook_options[] = {
N_
(
"Set tab borders"
),
N_
(
"NUMBER"
)
},
N_
(
"Set tab borders"
),
N_
(
"NUMBER"
)
},
{
"active-tab"
,
0
,
0
,
G_OPTION_ARG_INT
,
&
options
.
notebook_data
.
active
,
{
"active-tab"
,
0
,
0
,
G_OPTION_ARG_INT
,
&
options
.
notebook_data
.
active
,
N_
(
"Set active tab"
),
N_
(
"NUMBER"
)
},
N_
(
"Set active tab"
),
N_
(
"NUMBER"
)
},
{
"expand"
,
0
,
0
,
G_OPTION_ARG_NONE
,
&
options
.
notebook_data
.
expand
,
N_
(
"Expand tabs"
),
NULL
},
{
NULL
}
{
NULL
}
};
};
...
@@ -1576,6 +1578,7 @@ yad_options_init (void)
...
@@ -1576,6 +1578,7 @@ yad_options_init (void)
options
.
notebook_data
.
tabs
=
NULL
;
options
.
notebook_data
.
tabs
=
NULL
;
options
.
notebook_data
.
borders
=
5
;
options
.
notebook_data
.
borders
=
5
;
options
.
notebook_data
.
pos
=
GTK_POS_TOP
;
options
.
notebook_data
.
pos
=
GTK_POS_TOP
;
options
.
notebook_data
.
expand
=
FALSE
;
options
.
notebook_data
.
active
=
1
;
options
.
notebook_data
.
active
=
1
;
/* Initialize notification data */
/* Initialize notification data */
...
...
src/yad.h
View file @
86bfc4c9
...
@@ -366,6 +366,7 @@ typedef struct {
...
@@ -366,6 +366,7 @@ typedef struct {
guint
borders
;
guint
borders
;
GtkPositionType
pos
;
GtkPositionType
pos
;
guint
active
;
guint
active
;
gboolean
expand
;
}
YadNotebookData
;
}
YadNotebookData
;
typedef
struct
{
typedef
struct
{
...
...
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