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
d0a29e5c
Commit
d0a29e5c
authored
Mar 12, 2023
by
Victor Ananjevsky
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
improve placement of yad window. now negative zero as a coordinate works correctly
parent
4b40155c
Hide whitespace changes
Inline
Side-by-side
Showing
4 changed files
with
22 additions
and
4 deletions
+22
-4
main.c
src/main.c
+14
-4
option.c
src/option.c
+4
-0
util.c
src/util.c
+2
-0
yad.h
src/yad.h
+2
-0
No files found.
src/main.c
View file @
d0a29e5c
...
...
@@ -350,6 +350,7 @@ create_layout (GtkWidget *dlg)
static
void
realize_cb
(
GtkWidget
*
dlg
,
gpointer
d
)
{
GdkGravity
gravity
=
GDK_GRAVITY_NORTH_WEST
;
if
(
options
.
data
.
fixed
)
{
...
...
@@ -378,10 +379,19 @@ realize_cb (GtkWidget *dlg, gpointer d)
gtk_window_get_position
(
GTK_WINDOW
(
dlg
),
&
options
.
data
.
posx
,
NULL
);
if
(
!
options
.
data
.
use_posy
)
gtk_window_get_position
(
GTK_WINDOW
(
dlg
),
NULL
,
&
options
.
data
.
posy
);
if
(
options
.
data
.
posx
<
0
)
options
.
data
.
posx
=
sw
-
ww
+
options
.
data
.
posx
;
if
(
options
.
data
.
posy
<
0
)
options
.
data
.
posy
=
sh
-
wh
+
options
.
data
.
posy
;
if
(
options
.
data
.
negx
)
{
options
.
data
.
posx
=
sw
-
ww
+
options
.
data
.
posx
;
gravity
=
GDK_GRAVITY_NORTH_EAST
;
}
if
(
options
.
data
.
negy
)
{
options
.
data
.
posy
=
sh
-
wh
+
options
.
data
.
posy
;
gravity
=
GDK_GRAVITY_SOUTH_WEST
;
}
if
(
options
.
data
.
negx
&&
options
.
data
.
negy
)
gravity
=
GDK_GRAVITY_SOUTH_EAST
;
gtk_window_set_gravity
(
GTK_WINDOW
(
dlg
),
gravity
);
gtk_window_move
(
GTK_WINDOW
(
dlg
),
options
.
data
.
posx
,
options
.
data
.
posy
);
}
}
...
...
src/option.c
View file @
d0a29e5c
...
...
@@ -1239,6 +1239,7 @@ set_posx (const gchar * option_name, const gchar * value, gpointer data, GError
{
options
.
data
.
use_posx
=
TRUE
;
options
.
data
.
posx
=
atol
(
value
);
options
.
data
.
negx
=
(
*
value
==
'-'
);
return
TRUE
;
}
...
...
@@ -1248,6 +1249,7 @@ set_posy (const gchar * option_name, const gchar * value, gpointer data, GError
{
options
.
data
.
use_posy
=
TRUE
;
options
.
data
.
posy
=
atol
(
value
);
options
.
data
.
negy
=
(
*
value
==
'-'
);
return
TRUE
;
}
...
...
@@ -1592,8 +1594,10 @@ yad_options_init (void)
#endif
options
.
data
.
use_posx
=
FALSE
;
options
.
data
.
posx
=
0
;
options
.
data
.
negx
=
FALSE
;
options
.
data
.
use_posy
=
FALSE
;
options
.
data
.
posy
=
0
;
options
.
data
.
negy
=
FALSE
;
options
.
data
.
geometry
=
NULL
;
options
.
data
.
dialog_text
=
NULL
;
options
.
data
.
text_width
=
0
;
...
...
src/util.c
View file @
d0a29e5c
...
...
@@ -546,6 +546,7 @@ parse_geometry ()
ptr
=
geom
+
i
;
x
=
atoi
(
ptr
);
options
.
data
.
negx
=
(
*
ptr
==
'-'
);
i
++
;
while
(
geom
[
i
]
&&
geom
[
i
]
!=
'-'
&&
geom
[
i
]
!=
'+'
)
i
++
;
...
...
@@ -555,6 +556,7 @@ parse_geometry ()
ptr
=
geom
+
i
;
y
=
atoi
(
ptr
);
options
.
data
.
negy
=
(
*
ptr
==
'-'
);
}
if
(
w
!=
-
1
)
...
...
src/yad.h
View file @
d0a29e5c
...
...
@@ -227,8 +227,10 @@ typedef struct {
gint
height
;
gboolean
use_posx
;
gint
posx
;
gboolean
negx
;
gboolean
use_posy
;
gint
posy
;
gboolean
negy
;
gchar
*
geometry
;
guint
timeout
;
gchar
*
to_indicator
;
...
...
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