23 #ifndef SAYONARAWIDGETTEMPLATE_H 24 #define SAYONARAWIDGETTEMPLATE_H 33 #include "Helper/Settings/SayonaraClass.h" 35 #define combo_current_index_changed_int static_cast<void (QComboBox::*) (int)>(&QComboBox::currentIndexChanged) 36 #define combo_activated_int static_cast<void (QComboBox::*) (int)>(&QComboBox::activated) 37 #define spinbox_value_changed_int static_cast<void (QSpinBox::*) (int)>(&QSpinBox::valueChanged) 69 bool dark = (_settings->get(Set::Player_Style) == 1);
71 QPalette palette = this->palette();
72 QColor color = palette.color(QPalette::Normal, QPalette::Background);
74 if(color.lightness() < 128 || dark){
87 QString elide_text(
const QString &text, QWidget *widget,
int max_lines){
89 QFontMetrics metric = widget->fontMetrics();
90 int width = widget->width();
92 QStringList splitted = text.split(
" ");
97 for(
const QString& str : splitted){
101 if(metric.boundingRect(tmp).width() > width){
104 if(ret.size() == max_lines){
123 else if(line.isEmpty()){
124 final_str = ret.join(
"\n");
129 final_str = ret.join(
"\n") + line;
138 #endif // SAYONARAWIDGETTEMPLATE_H The SayonaraClass class provides access to Settings and notifications.
Definition: SayonaraClass.h:31