Top | ![]() |
![]() |
![]() |
![]() |
GtkWidget * | eos_window_new () |
EosPageManager * | eos_window_get_page_manager () |
void | eos_window_set_page_manager () |
gboolean | eos_window_get_font_scaling_active () |
void | eos_window_set_font_scaling_active () |
gint | eos_window_get_font_scaling_default_size () |
void | eos_window_set_font_scaling_default_size () |
gint | eos_window_get_font_scaling_default_window_size () |
void | eos_window_set_font_scaling_default_window_size () |
gint | eos_window_get_font_scaling_min_font_size () |
void | eos_window_set_font_scaling_min_font_size () |
gdouble | eos_window_get_font_scaling_calculated_font_size () |
EosApplication * | application | Read / Write / Construct Only |
gboolean | font-scaling-active | Read / Write / Construct |
gdouble | font-scaling-calculated-font-size | Read |
gint | font-scaling-default-size | Read / Write / Construct |
gint | font-scaling-default-window-size | Read / Write / Construct |
gint | font-scaling-min-font-size | Read / Write / Construct |
EosPageManager * | page-manager | Read / Write |
GObject ╰── GInitiallyUnowned ╰── GtkWidget ╰── GtkContainer ╰── GtkBin ╰── GtkWindow ╰── GtkApplicationWindow ╰── EosWindow
EosWindow implements AtkImplementorIface, GtkBuildable, GActionGroup and GActionMap.
The EosWindow class is where you put your application's user interface. You should create a class that extends EosWindow.
Create the interface in your window class's _init()
function, like this:
1 2 3 4 5 6 7 8 9 10 |
const SmokeGrinderWindow = new Lang.Class({ Name: 'SmokeGrinderWindow', Extends: Endless.Window, _init(): function (props) { this.parent(props); this._button = Gtk.Button({label: 'Push me'}); this.add(this._button); }, }); |
We will use an application-configurable base font size for application- configurable resolution and scale up/down from there for different screen sizes.
Font scaling can be enabled by setting “font-scaling-active” to true. Font scaling is turned off and the property is false by default.
The default font size by which font scaling will occur can be set by “font-scaling-default-size”.
The default window resolution height by which font scaling will occur can be set by “font-scaling-default-window-size”.
The default minimum font size under which a font will never scale can be set by “font-scaling-min-font-size”.
The calculated minimum font size by which children widgets will scale and can be retrieved by “font-scaling-calculated-font-size”. This property is only readable and is only set by EosWindow internally.
For instance, supose we have a default font size of 12px, a default window size of 720px, and a window allocation of 360px. The calculated font pixel size will be 12px * (360px / 720px) = 6px. A corresponding CSS font-size of 1em will be equivalent to 6 px. A CSS font-size of 0.5em will be equivalent to 3px. If the window is resized to a height of 720px, then the calculated pixel size will be 12px, and the CSS font-size of 1em will be equivalent to 12px. A CSS font-size of 0.5em will be equivalent to 6px. If the minimum font size is set to 12px, then the font-size will be forced to 12px, ignoring the calculated font size of 6px.
GtkWidget *
eos_window_new (EosApplication *application
);
Create a window. It is invisible by default.
void eos_window_set_page_manager (EosWindow *self
,EosPageManager *page_manager
);
Stub
gboolean
eos_window_get_font_scaling_active (EosWindow *self
);
See “font-scaling-active” for details.
void eos_window_set_font_scaling_active (EosWindow *self
,gboolean is_scaling
);
Sets whether or not the font will automatically scale. See “font-scaling-active” for details.
gint
eos_window_get_font_scaling_default_size
(EosWindow *self
);
See “font-scaling-default-size” for details.
void eos_window_set_font_scaling_default_size (EosWindow *self
,gint new_default_font_size
);
Sets the default font size by which the font size of children widgets will scale. See “font-scaling-default-size” for details.
gint
eos_window_get_font_scaling_default_window_size
(EosWindow *self
);
See “font-scaling-default-window-size” for details.
void eos_window_set_font_scaling_default_window_size (EosWindow *self
,gint new_default_window_size
);
Sets the default window size by which the font size of children widgets will scale. See “font-scaling-default-window-size” for details.
gint
eos_window_get_font_scaling_min_font_size
(EosWindow *self
);
See “font-scaling-min-font-size” for details.
void eos_window_set_font_scaling_min_font_size (EosWindow *self
,gint new_min_font_size
);
Sets the min font size by which the font size of children widgets will scale. See “font-scaling-min-font-size” for details.
gdouble
eos_window_get_font_scaling_calculated_font_size
(EosWindow *self
);
See “font-scaling-calculated-font-size” for details.
“application”
property“application” EosApplication *
The EosApplication that this window is associated with. See also
“application”; the difference is that “application”
cannot be NULL
and must be an EosApplication.
Flags: Read / Write / Construct Only
“font-scaling-active”
property “font-scaling-active” gboolean
The scaling flag that determines if the windows scale or not.
Flags: Read / Write / Construct
Default value: FALSE
“font-scaling-calculated-font-size”
property “font-scaling-calculated-font-size” gdouble
The calculated font-size by which children widgets scale. Units are in pixels.
Flags: Read
Allowed values: >= 1
Default value: 16
“font-scaling-default-size”
property “font-scaling-default-size” gint
The default font-size by which font scaling will occur. Units are in pixels.
Flags: Read / Write / Construct
Allowed values: >= 1
Default value: 16
“font-scaling-default-window-size”
property “font-scaling-default-window-size” gint
The base resolution by which font scaling will occur. Units are in pixels.
Flags: Read / Write / Construct
Allowed values: >= 1
Default value: 1080
“font-scaling-min-font-size”
property “font-scaling-min-font-size” gint
The minimum font-size under which font scaling won't occur. Units are in pixels.
Flags: Read / Write / Construct
Allowed values: >= 1
Default value: 10
“page-manager”
property“page-manager” EosPageManager *
The EosPageManager that controls the flow of this window's application.
Flags: Read / Write