Plank.Theme – plank Reference Manual

# Theme

## Object Hierarchy:

## Description:

public abstract class Theme : Preferences

A themed renderer for windows.

All known sub-classes:

- DockTheme

Namespace: Plank
Package: plank

## Content:

### Constants:

- public const string DEFAULT_NAME
- public const string GTK_THEME_NAME

### Properties:

- public int BottomRoundness { get; set; }
- public Color FillEndColor { get; set; }
- public Color FillStartColor { get; set; }
- public Color InnerStrokeColor { get; set; }
- public int LineWidth { get; set; }
- public Color OuterStrokeColor { get; set; }
- public int TopRoundness { get; set; }

### Static methods:

- public static StyleContext create_style_context (Type widget_type, StyleContext? parent_style, CssProvider provider, string? object_name, string first_class, ...)
- public static void draw_rounded_line (Context cr, double x, double y, double width, double height, bool is_round_left, bool is_round_right, Pattern? stroke = null, Pattern? fill = null)
  Draws a rounded horizontal line.
- public static void draw_rounded_rect (Context cr, double x, double y, double width, double height, double top_radius = 6.0, double bottom_radius = 6.0, double line_width = 1.0)
  Draws a rounded rectangle. If compositing is disabled, just draws a normal rectangle.
- public static File? get_theme_folder (string name)
  Try to get an already existing folder located in the themes folder while prefering the user's themes folder. If there is no folder found we fallback to the "Default" theme. If even that folder doesn't exist return NULL (and use built-in defaults)
- public static string[] get_theme_list ()
  Get a sorted array of all available theme-names

### Creation methods:

- protected Theme ()
- protected Theme.with_name (string name)

### Methods:

- public void draw_background (Surface surface)
  Draws a background onto the surface.
- protected void draw_inner_rect (Context cr, int width, int height)
  Similar to draw_rounded_rect, but moves in to avoid a containing rounded rect's lines.
- public int get_bottom_offset ()
  Returns the bottom offset.
- public unowned StyleContext get_style_context ()
- public int get_top_offset ()
  Returns the top offset.
- public void load (string type)
  Loads a theme for the renderer to use.
- protected override void reset_properties ()
  Resets all properties to their default values. Called from construct and before loading from the backing file.
- protected override void verify (string prop)
  This method will verify the value of a property. If the value is wrong, this method should replace it with a sanitized value.

### Inherited Members:

All known members inherited from class Plank.Preferences

- @delete
- apply
- delay
- deleted

- get_backing_file
- get_filename
- init_from_file

- init_from_filename
- reset_properties
- verify

All known members inherited from class GLib.Object

- @get
- @new
- @ref
- @set
- add_toggle_ref
- add_weak_pointer
- bind_property
- connect
- constructed
- disconnect
- dispose
- dup_data
- dup_qdata
- force_floating
- freeze_notify
- get_class
- get_data

- get_property
- get_qdata
- get_type
- getv
- interface_find_property
- interface_install_property
- interface_list_properties
- is_floating
- new_valist
- new_with_properties
- newv
- notify
- notify_property
- ref_count
- ref_sink
- remove_toggle_ref
- remove_weak_pointer

- replace_data
- replace_qdata
- set_data
- set_data_full
- set_property
- set_qdata
- set_qdata_full
- set_valist
- setv
- steal_data
- steal_qdata
- thaw_notify
- unref
- watch_closure
- weak_ref
- weak_unref