Skip to content
Projects
Groups
Snippets
Help
Loading...
Help
Support
Keyboard shortcuts
?
Submit feedback
Sign in / Register
Toggle navigation
P
phosh
Project overview
Project overview
Details
Activity
Releases
Repository
Repository
Files
Commits
Branches
Tags
Contributors
Graph
Compare
Merge Requests
0
Merge Requests
0
CI / CD
CI / CD
Pipelines
Jobs
Schedules
Packages & Registries
Packages & Registries
Container Registry
Analytics
Analytics
CI / CD
Repository
Value Stream
Wiki
Wiki
Snippets
Snippets
Members
Members
Collapse sidebar
Close sidebar
Activity
Graph
Jobs
Commits
Open sidebar
Guido Gunther
phosh
Commits
2b6064b9
Commit
2b6064b9
authored
Mar 28, 2018
by
Guido Gunther
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
panel: allow to query height
so we can use it for usable area calculations
parent
f14416f2
Changes
2
Hide whitespace changes
Inline
Side-by-side
Showing
2 changed files
with
23 additions
and
0 deletions
+23
-0
src/panel.c
src/panel.c
+22
-0
src/panel.h
src/panel.h
+1
-0
No files found.
src/panel.c
View file @
2b6064b9
...
...
@@ -27,6 +27,7 @@ static guint signals[N_SIGNALS] = { 0 };
struct
PhoshPanelPrivate
{
GtkWidget
*
btn_favorites
;
GtkWidget
*
btn_settings
;
gint
height
;
GnomeWallClock
*
wall_clock
;
};
...
...
@@ -70,6 +71,15 @@ wall_clock_notify_cb (GnomeWallClock *wall_clock,
}
static
void
size_allocated_cb
(
PhoshPanel
*
self
,
gpointer
unused
)
{
gint
width
;
PhoshPanelPrivate
*
priv
=
phosh_panel_get_instance_private
(
self
);
gtk_window_get_size
(
GTK_WINDOW
(
self
),
&
width
,
&
priv
->
height
);
}
static
void
phosh_panel_constructed
(
GObject
*
object
)
{
...
...
@@ -96,6 +106,10 @@ phosh_panel_constructed (GObject *object)
G_CALLBACK
(
settings_clicked_cb
),
self
,
G_CONNECT_SWAPPED
);
g_signal_connect
(
self
,
"size-allocate"
,
G_CALLBACK
(
size_allocated_cb
),
NULL
);
/* window properties */
gtk_window_set_title
(
GTK_WINDOW
(
self
),
"phosh panel"
);
...
...
@@ -169,3 +183,11 @@ phosh_panel_new (void)
return
g_object_new
(
PHOSH_PANEL_TYPE
,
NULL
);
}
gint
phosh_panel_get_height
(
PhoshPanel
*
self
)
{
PhoshPanelPrivate
*
priv
=
phosh_panel_get_instance_private
(
self
);
return
priv
->
height
;
}
src/panel.h
View file @
2b6064b9
...
...
@@ -35,5 +35,6 @@ struct PhoshPanelClass
GType
phosh_panel_get_type
(
void
)
G_GNUC_CONST
;
GtkWidget
*
phosh_panel_new
(
void
);
gint
phosh_panel_get_height
(
PhoshPanel
*
self
);
#endif
/* PHOSH_PANEL_H */
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