rofi
1.7.0
|
#include "widgets/widget.h"
#include "theme.h"
#include "widgets/widget-internal.h"
#include <glib.h>
#include <math.h>
Go to the source code of this file.
Macros | |
#define | WIDGET_DEFAULT_PADDING 0 |
#define | WIDGET_PADDING_INIT |
#define WIDGET_PADDING_INIT |
macro for initializing the padding struction.
void widget_init | ( | widget * | wid, |
widget * | parent, | ||
WidgetType | type, | ||
const char * | name | ||
) |
wid | The widget to initialize. |
parent | The widget's parent. |
type | The type of the widget. |
name | The name of the widget. |
Initializes the widget structure.
Definition at line 44 of file widget.c.
References _widget::border, _widget::border_radius, _widget::cursor_type, _widget::def_border, _widget::def_border_radius, _widget::def_margin, _widget::def_padding, _widget::enabled, _widget::margin, _widget::name, _widget::padding, _widget::parent, ROFI_CURSOR_DEFAULT, rofi_theme_get_boolean(), rofi_theme_get_cursor_type(), rofi_theme_get_padding(), _widget::type, and WIDGET_PADDING_INIT.
Referenced by box_create(), container_create(), icon_create(), listview_create(), scrollbar_create(), and textbox_create().
int widget_padding_get_bottom | ( | const widget * | wid | ) |
wid | The widget handle. |
Get the bottom padding of the widget.
Definition at line 613 of file widget.c.
References _widget::border, RofiPadding::bottom, distance_get_pixel(), _widget::margin, _widget::padding, and ROFI_ORIENTATION_VERTICAL.
Referenced by icon_draw(), listview_draw(), textbox_draw(), widget_padding_get_padding_height(), and widget_padding_get_remaining_height().
int widget_padding_get_left | ( | const widget * | wid | ) |
wid | The widget handle. |
Get the left padding of the widget.
Definition at line 581 of file widget.c.
References _widget::border, distance_get_pixel(), RofiPadding::left, _widget::margin, _widget::padding, and ROFI_ORIENTATION_HORIZONTAL.
Referenced by barview_draw(), container_update(), hori_calculate_size(), icon_draw(), listview_draw(), scrollbar_draw(), textbox_draw(), textbox_editable_trigger_action(), textbox_get_desired_width(), vert_calculate_size(), widget_padding_get_padding_width(), and widget_padding_get_remaining_width().
int widget_padding_get_padding_height | ( | const widget * | wid | ) |
wid | The widget handle. |
Get the combined top and bottom padding.
Definition at line 636 of file widget.c.
References widget_padding_get_bottom(), and widget_padding_get_top().
Referenced by box_add(), box_get_desired_height(), container_get_desired_height(), icon_get_desired_height(), listview_get_desired_height(), listview_resize(), scrollbar_create(), textbox_get_estimated_height(), textbox_get_height(), and vert_calculate_size().
int widget_padding_get_padding_width | ( | const widget * | wid | ) |
wid | The widget handle. |
Get the combined left and right padding.
Definition at line 642 of file widget.c.
References widget_padding_get_left(), and widget_padding_get_right().
Referenced by barview_draw(), box_add(), box_get_desired_width(), hori_calculate_size(), icon_get_desired_width(), listview_draw(), scrollbar_create(), textbox_draw(), textbox_get_desired_width(), textbox_get_width(), and textbox_moveresize().
int widget_padding_get_remaining_height | ( | const widget * | wid | ) |
wid | The widget handle. |
Get height of the content of the widget
Definition at line 630 of file widget.c.
References _widget::h, widget_padding_get_bottom(), and widget_padding_get_top().
Referenced by container_update(), hori_calculate_size(), scrollbar_draw(), and vert_calculate_size().
int widget_padding_get_remaining_width | ( | const widget * | wid | ) |
wid | The widget handle. |
Get width of the content of the widget
Definition at line 624 of file widget.c.
References _widget::w, widget_padding_get_left(), and widget_padding_get_right().
Referenced by container_update(), hori_calculate_size(), scrollbar_draw(), and vert_calculate_size().
int widget_padding_get_right | ( | const widget * | wid | ) |
wid | The widget handle. |
Get the right padding of the widget.
Definition at line 591 of file widget.c.
References _widget::border, distance_get_pixel(), _widget::margin, _widget::padding, RofiPadding::right, and ROFI_ORIENTATION_HORIZONTAL.
Referenced by barview_draw(), icon_draw(), listview_resize(), textbox_get_desired_width(), widget_padding_get_padding_width(), and widget_padding_get_remaining_width().
int widget_padding_get_top | ( | const widget * | wid | ) |
wid | The widget handle. |
Get the top padding of the widget.
Definition at line 603 of file widget.c.
References _widget::border, distance_get_pixel(), _widget::margin, _widget::padding, ROFI_ORIENTATION_VERTICAL, and RofiPadding::top.
Referenced by barview_draw(), container_update(), hori_calculate_size(), icon_draw(), listview_draw(), listview_resize(), scrollbar_draw(), textbox_draw(), vert_calculate_size(), widget_padding_get_padding_height(), and widget_padding_get_remaining_height().
void widget_set_state | ( | widget * | widget, |
const char * | state | ||
) |
widget | The widget handle. |
state | The state of the widget. |
Set the state of the widget.
Definition at line 72 of file widget.c.
References _widget::border, _widget::border_radius, _widget::def_border, _widget::def_border_radius, rofi_theme_get_padding(), _widget::set_state, _widget::state, and widget_queue_redraw().
Referenced by box_set_state(), container_set_state(), listview_set_state(), and textbox_font().