mirror of
https://github.com/obsproject/obs-studio.git
synced 2026-04-15 12:09:33 -04:00
UI: Use new truncate function with hotkeys
This updates the hotkeys to use the new truncate label function in qt-wrappers.cpp
This commit is contained in:
committed by
Matt Gajownik
parent
50372164d0
commit
e40a6be031
@@ -2728,8 +2728,6 @@ void OBSBasicSettings::LoadAdvancedSettings()
|
||||
loading = false;
|
||||
}
|
||||
|
||||
#define TRUNCATE_TEXT_LENGTH 80
|
||||
|
||||
template<typename Func>
|
||||
static inline void
|
||||
LayoutHotkey(OBSBasicSettings *settings, obs_hotkey_id id, obs_hotkey_t *key,
|
||||
@@ -2740,13 +2738,7 @@ LayoutHotkey(OBSBasicSettings *settings, obs_hotkey_id id, obs_hotkey_t *key,
|
||||
QString text = QT_UTF8(obs_hotkey_get_description(key));
|
||||
|
||||
label->setProperty("fullName", text);
|
||||
|
||||
if (text.length() > TRUNCATE_TEXT_LENGTH) {
|
||||
text = text.left(TRUNCATE_TEXT_LENGTH);
|
||||
text += "...'";
|
||||
}
|
||||
|
||||
label->setText(text);
|
||||
TruncateLabel(label, text);
|
||||
|
||||
OBSHotkeyWidget *hw = nullptr;
|
||||
|
||||
@@ -2778,14 +2770,7 @@ static QLabel *makeLabel(const OBSSource &source, Func &&)
|
||||
OBSSourceLabel *label = new OBSSourceLabel(source);
|
||||
label->setStyleSheet("font-weight: bold;");
|
||||
QString name = QT_UTF8(obs_source_get_name(source));
|
||||
|
||||
if (name.length() > TRUNCATE_TEXT_LENGTH) {
|
||||
label->setToolTip(name);
|
||||
name = name.left(TRUNCATE_TEXT_LENGTH);
|
||||
name += "...";
|
||||
}
|
||||
|
||||
label->setText(name);
|
||||
TruncateLabel(label, name);
|
||||
|
||||
return label;
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user