mirror of
https://github.com/ciphervance/supercell-wx.git
synced 2025-10-30 17:50:04 +00:00
Add hover text wrap to settings
This commit is contained in:
parent
fc6cdc729b
commit
f9e69d15e4
10 changed files with 218 additions and 10 deletions
|
|
@ -7,6 +7,7 @@
|
|||
#include <scwx/qt/manager/settings_manager.hpp>
|
||||
#include <scwx/qt/map/map_provider.hpp>
|
||||
#include <scwx/qt/settings/settings_interface.hpp>
|
||||
#include <scwx/qt/settings/text_settings.hpp>
|
||||
#include <scwx/qt/types/alert_types.hpp>
|
||||
#include <scwx/qt/ui/placefile_settings_widget.hpp>
|
||||
#include <scwx/qt/ui/radar_site_dialog.hpp>
|
||||
|
|
@ -92,7 +93,8 @@ public:
|
|||
&mapTilerApiKey_,
|
||||
&defaultAlertAction_,
|
||||
&updateNotificationsEnabled_,
|
||||
&debugEnabled_}}
|
||||
&debugEnabled_,
|
||||
&hoverTextWrap_}}
|
||||
{
|
||||
// Configure default alert phenomena colors
|
||||
auto& paletteSettings = manager::SettingsManager::palette_settings();
|
||||
|
|
@ -117,6 +119,7 @@ public:
|
|||
void SetupPalettesColorTablesTab();
|
||||
void SetupPalettesAlertsTab();
|
||||
void SetupPlacefilesTab();
|
||||
void SetupTextTab();
|
||||
|
||||
void ShowColorDialog(QLineEdit* lineEdit, QFrame* frame = nullptr);
|
||||
void UpdateRadarDialogLocation(const std::string& id);
|
||||
|
|
@ -139,7 +142,7 @@ public:
|
|||
static void SetBackgroundColor(const std::string& value, QFrame* frame);
|
||||
|
||||
SettingsDialog* self_;
|
||||
PlacefileSettingsWidget* placefileSettingsWidget_;
|
||||
PlacefileSettingsWidget* placefileSettingsWidget_ {nullptr};
|
||||
RadarSiteDialog* radarSiteDialog_;
|
||||
|
||||
settings::SettingsInterface<std::string> defaultRadarSite_ {};
|
||||
|
|
@ -162,6 +165,8 @@ public:
|
|||
settings::SettingsInterface<std::string>>
|
||||
inactiveAlertColors_ {};
|
||||
|
||||
settings::SettingsInterface<std::int64_t> hoverTextWrap_ {};
|
||||
|
||||
std::vector<settings::SettingsInterfaceBase*> settings_;
|
||||
};
|
||||
|
||||
|
|
@ -181,6 +186,9 @@ SettingsDialog::SettingsDialog(QWidget* parent) :
|
|||
// Palettes > Alerts
|
||||
p->SetupPalettesAlertsTab();
|
||||
|
||||
// Text
|
||||
p->SetupTextTab();
|
||||
|
||||
// Placefiles
|
||||
p->SetupPlacefilesTab();
|
||||
|
||||
|
|
@ -630,6 +638,15 @@ void SettingsDialogImpl::SetupPlacefilesTab()
|
|||
self_->ui->placefiles->layout()->addWidget(placefileSettingsWidget_);
|
||||
}
|
||||
|
||||
void SettingsDialogImpl::SetupTextTab()
|
||||
{
|
||||
settings::TextSettings& textSettings = settings::TextSettings::Instance();
|
||||
|
||||
hoverTextWrap_.SetSettingsVariable(textSettings.hover_text_wrap());
|
||||
hoverTextWrap_.SetEditWidget(self_->ui->hoverTextWrapSpinBox);
|
||||
hoverTextWrap_.SetResetButton(self_->ui->resetHoverTextWrapButton);
|
||||
}
|
||||
|
||||
QImage SettingsDialogImpl::GenerateColorTableImage(
|
||||
std::shared_ptr<common::ColorTable> colorTable,
|
||||
std::uint16_t min,
|
||||
|
|
|
|||
|
|
@ -73,6 +73,15 @@
|
|||
<normaloff>:/res/icons/font-awesome-6/palette-solid.svg</normaloff>:/res/icons/font-awesome-6/palette-solid.svg</iconset>
|
||||
</property>
|
||||
</item>
|
||||
<item>
|
||||
<property name="text">
|
||||
<string>Text</string>
|
||||
</property>
|
||||
<property name="icon">
|
||||
<iconset resource="../../../../scwx-qt.qrc">
|
||||
<normaloff>:/res/icons/font-awesome-6/font-solid.svg</normaloff>:/res/icons/font-awesome-6/font-solid.svg</iconset>
|
||||
</property>
|
||||
</item>
|
||||
<item>
|
||||
<property name="text">
|
||||
<string>Placefiles</string>
|
||||
|
|
@ -355,8 +364,8 @@
|
|||
<rect>
|
||||
<x>0</x>
|
||||
<y>0</y>
|
||||
<width>66</width>
|
||||
<height>18</height>
|
||||
<width>481</width>
|
||||
<height>382</height>
|
||||
</rect>
|
||||
</property>
|
||||
<layout class="QGridLayout" name="gridLayout_3">
|
||||
|
|
@ -427,6 +436,72 @@
|
|||
</item>
|
||||
</layout>
|
||||
</widget>
|
||||
<widget class="QWidget" name="text">
|
||||
<layout class="QVBoxLayout" name="verticalLayout_5">
|
||||
<item>
|
||||
<widget class="QFrame" name="frame_3">
|
||||
<property name="frameShape">
|
||||
<enum>QFrame::StyledPanel</enum>
|
||||
</property>
|
||||
<property name="frameShadow">
|
||||
<enum>QFrame::Raised</enum>
|
||||
</property>
|
||||
<layout class="QGridLayout" name="gridLayout_7">
|
||||
<property name="leftMargin">
|
||||
<number>0</number>
|
||||
</property>
|
||||
<property name="topMargin">
|
||||
<number>0</number>
|
||||
</property>
|
||||
<property name="rightMargin">
|
||||
<number>0</number>
|
||||
</property>
|
||||
<property name="bottomMargin">
|
||||
<number>0</number>
|
||||
</property>
|
||||
<item row="0" column="0">
|
||||
<widget class="QLabel" name="label_8">
|
||||
<property name="text">
|
||||
<string>Hover text character wrap (0 to disable)</string>
|
||||
</property>
|
||||
</widget>
|
||||
</item>
|
||||
<item row="0" column="1">
|
||||
<widget class="QSpinBox" name="hoverTextWrapSpinBox">
|
||||
<property name="maximum">
|
||||
<number>999</number>
|
||||
</property>
|
||||
</widget>
|
||||
</item>
|
||||
<item row="0" column="2">
|
||||
<widget class="QToolButton" name="resetHoverTextWrapButton">
|
||||
<property name="text">
|
||||
<string>...</string>
|
||||
</property>
|
||||
<property name="icon">
|
||||
<iconset resource="../../../../scwx-qt.qrc">
|
||||
<normaloff>:/res/icons/font-awesome-6/rotate-left-solid.svg</normaloff>:/res/icons/font-awesome-6/rotate-left-solid.svg</iconset>
|
||||
</property>
|
||||
</widget>
|
||||
</item>
|
||||
</layout>
|
||||
</widget>
|
||||
</item>
|
||||
<item>
|
||||
<spacer name="verticalSpacer_4">
|
||||
<property name="orientation">
|
||||
<enum>Qt::Vertical</enum>
|
||||
</property>
|
||||
<property name="sizeHint" stdset="0">
|
||||
<size>
|
||||
<width>20</width>
|
||||
<height>40</height>
|
||||
</size>
|
||||
</property>
|
||||
</spacer>
|
||||
</item>
|
||||
</layout>
|
||||
</widget>
|
||||
<widget class="QWidget" name="placefiles">
|
||||
<layout class="QVBoxLayout" name="verticalLayout_4">
|
||||
<property name="leftMargin">
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue