:right-sidebar: True LengthUnit =================================================================== .. currentmodule:: gi.repository.Adw .. versionadded:: 1.4 .. class:: LengthUnit :no-contents-entry: Describes length units. +------+--------------+------------+ | Unit | Regular Text | Large Text | +------+--------------+------------+ | ---- | ------------ | ---------- | +------+--------------+------------+ | 1px | 1px | 1px | +------+--------------+------------+ | 1pt | 1.333333px | 1.666667px | +------+--------------+------------+ | 1sp | 1px | 1.25px | +------+--------------+------------+ New values may be added to this enumeration over time. Methods ------- .. rst-class:: interim-class .. class:: LengthUnit :no-index: .. method:: from_px(unit: ~gi.repository.Adw.LengthUnit, value: float, settings: ~gi.repository.Gtk.Settings | None = None) -> float Converts ``value`` from pixels to ``unit``. .. versionadded:: 1.4 :param unit: a length unit :param value: a value in pixels :param settings: settings to use, or ``NULL`` for default settings .. method:: to_px(unit: ~gi.repository.Adw.LengthUnit, value: float, settings: ~gi.repository.Gtk.Settings | None = None) -> float Converts ``value`` from ``unit`` to pixels. .. versionadded:: 1.4 :param unit: a length unit :param value: a value in ``unit`` :param settings: settings to use, or ``NULL`` for default settings Fields ------ .. rst-class:: interim-class .. class:: LengthUnit :no-index: .. attribute:: PT Points, changes with text scale factor .. attribute:: PX Pixels .. attribute:: SP Scale independent pixels, changes with text scale factor