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
9afcb1f7
Commit
9afcb1f7
authored
Feb 15, 2019
by
Victor Ananjevsky
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
fix gtk versions in conditions
parent
8274b979
Hide whitespace changes
Inline
Side-by-side
Showing
3 changed files
with
16 additions
and
16 deletions
+16
-16
color.c
src/color.c
+5
-5
font.c
src/font.c
+5
-5
form.c
src/form.c
+6
-6
No files found.
src/color.c
View file @
9afcb1f7
...
...
@@ -98,7 +98,7 @@ create_palette ()
static
void
set_color
(
gchar
*
clr
)
{
#if !GTK_CHECK_VERSION(3,
0
,0)
#if !GTK_CHECK_VERSION(3,
4
,0)
GdkColor
c
;
if
(
gdk_color_parse
(
clr
,
&
c
))
gtk_color_selection_set_current_color
(
GTK_COLOR_SELECTION
(
color
),
&
c
);
...
...
@@ -128,7 +128,7 @@ color_create_widget (GtkWidget * dlg)
{
GtkWidget
*
w
;
#if !GTK_CHECK_VERSION(3,
0
,0)
#if !GTK_CHECK_VERSION(3,
4
,0)
w
=
gtk_vbox_new
(
FALSE
,
2
);
color
=
gtk_color_selection_new
();
#else
...
...
@@ -137,7 +137,7 @@ color_create_widget (GtkWidget * dlg)
#endif
gtk_widget_set_name
(
color
,
"yad-color-widget"
);
#if !GTK_CHECK_VERSION(3,
0
,0)
#if !GTK_CHECK_VERSION(3,
4
,0)
gtk_color_selection_set_has_palette
(
GTK_COLOR_SELECTION
(
color
),
options
.
color_data
.
gtk_palette
);
#else
g_object_set
(
G_OBJECT
(
color
),
"show-editor"
,
!
options
.
color_data
.
gtk_palette
,
NULL
);
...
...
@@ -218,7 +218,7 @@ color_create_widget (GtkWidget * dlg)
void
color_print_result
(
void
)
{
#if !GTK_CHECK_VERSION(3,
0
,0)
#if !GTK_CHECK_VERSION(3,
4
,0)
GdkColor
c
;
guint64
alpha
;
#else
...
...
@@ -226,7 +226,7 @@ color_print_result (void)
#endif
gchar
*
cs
;
#if !GTK_CHECK_VERSION(3,
0
,0)
#if !GTK_CHECK_VERSION(3,
4
,0)
gtk_color_selection_get_current_color
(
GTK_COLOR_SELECTION
(
color
),
&
c
);
alpha
=
gtk_color_selection_get_current_alpha
(
GTK_COLOR_SELECTION
(
color
));
cs
=
get_color
(
&
c
,
alpha
);
...
...
src/font.c
View file @
9afcb1f7
...
...
@@ -28,7 +28,7 @@ static GtkWidget *font;
static
void
realize_cb
(
GtkWidget
*
w
,
gpointer
d
)
{
#if GTK_CHECK_VERSION(3,
0
,0)
#if GTK_CHECK_VERSION(3,
2
,0)
gtk_font_chooser_set_font
(
GTK_FONT_CHOOSER
(
w
),
options
.
common_data
.
font
);
#else
gtk_font_selection_set_font_name
(
GTK_FONT_SELECTION
(
w
),
options
.
common_data
.
font
);
...
...
@@ -40,7 +40,7 @@ font_create_widget (GtkWidget * dlg)
{
GtkWidget
*
w
;
#if GTK_CHECK_VERSION(3,
0
,0)
#if GTK_CHECK_VERSION(3,
2
,0)
w
=
font
=
gtk_font_chooser_widget_new
();
#else
w
=
font
=
gtk_font_selection_new
();
...
...
@@ -48,7 +48,7 @@ font_create_widget (GtkWidget * dlg)
gtk_widget_set_name
(
w
,
"yad-font-widget"
);
if
(
options
.
font_data
.
preview
)
#if GTK_CHECK_VERSION(3,
0
,0)
#if GTK_CHECK_VERSION(3,
2
,0)
gtk_font_chooser_set_preview_text
(
GTK_FONT_CHOOSER
(
w
),
options
.
font_data
.
preview
);
#else
gtk_font_selection_set_preview_text
(
GTK_FONT_SELECTION
(
w
),
options
.
font_data
.
preview
);
...
...
@@ -70,7 +70,7 @@ font_print_result (void)
PangoFontFamily
*
family
;
gint
size
;
#if GTK_CHECK_VERSION(3,
0
,0)
#if GTK_CHECK_VERSION(3,
2
,0)
face
=
gtk_font_chooser_get_font_face
(
GTK_FONT_CHOOSER
(
font
));
family
=
gtk_font_chooser_get_font_family
(
GTK_FONT_CHOOSER
(
font
));
size
=
gtk_font_chooser_get_font_size
(
GTK_FONT_CHOOSER
(
font
));
...
...
@@ -99,7 +99,7 @@ font_print_result (void)
}
else
{
#if GTK_CHECK_VERSION(3,
0
,0)
#if GTK_CHECK_VERSION(3,
2
,0)
gchar
*
fn
=
gtk_font_chooser_get_font
(
GTK_FONT_CHOOSER
(
font
));
#else
gchar
*
fn
=
gtk_font_selection_get_font_name
(
GTK_FONT_SELECTION
(
font
));
...
...
src/form.c
View file @
9afcb1f7
...
...
@@ -103,7 +103,7 @@ expand_action (gchar * cmd)
arg
=
g_shell_quote
(
gtk_file_chooser_get_filename
(
GTK_FILE_CHOOSER
(
g_slist_nth_data
(
fields
,
num
))));
break
;
case
YAD_FIELD_FONT
:
#if !GTK_CHECK_VERSION(3,
0
,0)
#if !GTK_CHECK_VERSION(3,
2
,0)
arg
=
g_shell_quote
(
gtk_font_button_get_font_name
(
GTK_FONT_BUTTON
(
g_slist_nth_data
(
fields
,
num
))));
#else
arg
=
g_shell_quote
(
gtk_font_chooser_get_font
(
GTK_FONT_CHOOSER
(
g_slist_nth_data
(
fields
,
num
))));
...
...
@@ -111,7 +111,7 @@ expand_action (gchar * cmd)
break
;
case
YAD_FIELD_COLOR
:
{
#if !GTK_CHECK_VERSION(3,
0
,0)
#if !GTK_CHECK_VERSION(3,
4
,0)
GdkColor
c
;
GtkColorButton
*
cb
=
GTK_COLOR_BUTTON
(
g_slist_nth_data
(
fields
,
num
));
gtk_color_button_get_color
(
cb
,
&
c
);
...
...
@@ -318,7 +318,7 @@ set_field_value (guint num, gchar * value)
break
;
case
YAD_FIELD_FONT
:
#if !GTK_CHECK_VERSION(3,
0
,0)
#if !GTK_CHECK_VERSION(3,
2
,0)
gtk_font_button_set_font_name
(
GTK_FONT_BUTTON
(
w
),
value
);
#else
gtk_font_chooser_set_font
(
GTK_FONT_CHOOSER
(
w
),
value
);
...
...
@@ -331,7 +331,7 @@ set_field_value (guint num, gchar * value)
case
YAD_FIELD_COLOR
:
{
#if !GTK_CHECK_VERSION(3,
0
,0)
#if !GTK_CHECK_VERSION(3,
4
,0)
GdkColor
c
;
gdk_color_parse
(
value
,
&
c
);
gtk_color_button_set_color
(
GTK_COLOR_BUTTON
(
w
),
&
c
);
...
...
@@ -1269,7 +1269,7 @@ form_print_field (guint fn)
case
YAD_FIELD_FONT
:
{
gchar
*
fname
;
#if !GTK_CHECK_VERSION(3,
0
,0)
#if !GTK_CHECK_VERSION(3,
2
,0)
fname
=
(
gchar
*
)
gtk_font_button_get_font_name
(
GTK_FONT_BUTTON
(
g_slist_nth_data
(
fields
,
fn
)));
#else
fname
=
gtk_font_chooser_get_font
(
GTK_FONT_CHOOSER
(
g_slist_nth_data
(
fields
,
fn
)));
...
...
@@ -1284,7 +1284,7 @@ form_print_field (guint fn)
case
YAD_FIELD_COLOR
:
{
gchar
*
cs
;
#if !GTK_CHECK_VERSION(3,
0
,0)
#if !GTK_CHECK_VERSION(3,
4
,0)
GdkColor
c
;
GtkColorButton
*
cb
=
GTK_COLOR_BUTTON
(
g_slist_nth_data
(
fields
,
fn
));
gtk_color_button_get_color
(
cb
,
&
c
);
...
...
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