added auto resizing input & settings
This commit is contained in:
@@ -26,7 +26,11 @@ public:
|
||||
void
|
||||
set(bool value)
|
||||
{
|
||||
this->value = value;
|
||||
if (this->value != value) {
|
||||
this->value = value;
|
||||
|
||||
emit valueChanged(value);
|
||||
}
|
||||
}
|
||||
|
||||
void
|
||||
@@ -39,6 +43,9 @@ public:
|
||||
{
|
||||
}
|
||||
|
||||
signals:
|
||||
void valueChanged(bool value);
|
||||
|
||||
private:
|
||||
bool value;
|
||||
bool defaultValue;
|
||||
|
||||
@@ -7,10 +7,10 @@
|
||||
|
||||
namespace chatterino {
|
||||
namespace settings {
|
||||
class BoolSetting : public Setting
|
||||
class IntSetting : public Setting
|
||||
{
|
||||
public:
|
||||
BoolSetting(const QString &name, int defaultValue)
|
||||
IntSetting(const QString &name, int defaultValue)
|
||||
: Setting(name)
|
||||
, value(defaultValue)
|
||||
, defaultValue(defaultValue)
|
||||
|
||||
@@ -31,6 +31,7 @@ BoolSetting Settings::enableGifAnimations("", true);
|
||||
BoolSetting Settings::enableGifs("", true);
|
||||
BoolSetting Settings::inlineWhispers("", true);
|
||||
BoolSetting Settings::windowTopMost("", true);
|
||||
BoolSetting Settings::compactTabs("", false);
|
||||
|
||||
QSettings Settings::settings(
|
||||
QStandardPaths::writableLocation(QStandardPaths::AppDataLocation),
|
||||
|
||||
@@ -71,6 +71,7 @@ private:
|
||||
settingsItems.push_back(&enableGifs);
|
||||
settingsItems.push_back(&inlineWhispers);
|
||||
settingsItems.push_back(&windowTopMost);
|
||||
settingsItems.push_back(&compactTabs);
|
||||
}
|
||||
|
||||
static QSettings settings;
|
||||
@@ -215,6 +216,11 @@ public:
|
||||
{
|
||||
return Settings::windowTopMost;
|
||||
}
|
||||
static BoolSetting
|
||||
getCompactTabs()
|
||||
{
|
||||
return Settings::compactTabs;
|
||||
}
|
||||
|
||||
private:
|
||||
static StringSetting theme;
|
||||
@@ -242,6 +248,7 @@ private:
|
||||
static BoolSetting enableGifs;
|
||||
static BoolSetting inlineWhispers;
|
||||
static BoolSetting windowTopMost;
|
||||
static BoolSetting compactTabs;
|
||||
};
|
||||
}
|
||||
}
|
||||
|
||||
@@ -27,7 +27,13 @@ public:
|
||||
const QString &
|
||||
set(const QString &value)
|
||||
{
|
||||
return (this->value = value);
|
||||
this->value = value;
|
||||
|
||||
QString tmp = value;
|
||||
|
||||
emit valueChanged(tmp);
|
||||
|
||||
return this->value;
|
||||
}
|
||||
|
||||
void
|
||||
@@ -40,6 +46,9 @@ public:
|
||||
{
|
||||
}
|
||||
|
||||
signals:
|
||||
void valueChanged(const QString &value);
|
||||
|
||||
private:
|
||||
QString value;
|
||||
QString defaultValue;
|
||||
|
||||
Reference in New Issue
Block a user