GNU Octave  8.1.0
A high-level interpreted language, primarily intended for numerical computations, mostly compatible with Matlab
gui-utils.cc File Reference
#include <QApplication>
#include <QRect>
#include <QScreen>
#include "gui-utils.h"
Include dependency graph for gui-utils.cc:

Go to the source code of this file.

Functions

OCTGUI_API void adjust_to_screen (QRect &actual_geometry, const QRect &default_geometry)
 
OCTGUI_API void get_screen_geometry (int &width, int &height)
 
OCTGUI_API QColor interpolate_color (const QColor &col1, const QColor &col2, double fs, double fv)
 

Function Documentation

◆ adjust_to_screen()

OCTGUI_API void adjust_to_screen ( QRect &  actual_geometry,
const QRect &  default_geometry 
)

Adjust geometry to be completely on a screen

Parameters
actual_geometryQRect with actual widget geometry; this is changed to the updated geometry which is on the screen.
default_geometrythe default geometry that is used in case the actual geometry os on no available screen.

Definition at line 60 of file gui-utils.cc.

Referenced by octave_dock_widget::handle_settings(), and find_dialog::restore_settings().

◆ get_screen_geometry()

OCTGUI_API void get_screen_geometry ( int &  width,
int &  height 
)

Get the screen geometry of the actual screen.

Parameters
widthinteger variable for storing the screen width
heightinteger variable for storing the screen height

Definition at line 51 of file gui-utils.cc.

Referenced by release_notes::release_notes(), community_news::construct(), and main_window::set_default_geometry().

◆ interpolate_color()

OCTGUI_API QColor interpolate_color ( const QColor &  col1,
const QColor &  col2,
double  fs,
double  fv 
)

Deterimine an alternative color to col1 with less contrast to col2. The HSV representation of the new color is calculated by

\begin{eqnarray*} H &=& H_1\\ S &=& f_s S_1\\ V &=& V_1 + f_s (V_2 - V_1) \end{eqnarray*}

Parameters
col1Base color to which the alternative has to be computed
col2Color to which the the new color should have less contrast
fsFactor for changing the saturation $(0\ldots\infty)$
fvFactor for interpolating the brightness $(0\ldots 1)$. For 0, $V = V_1$ and for 1, $V = V_2$.
Returns
New color as QColor

Definition at line 39 of file gui-utils.cc.

References v2.

Referenced by led_indicator::style_sheet(), and file_editor_tab::update_lexer_settings().