added auto resizing input & settings

This commit is contained in:
fourtf
2017-01-21 05:14:27 +01:00
parent d215bd58b0
commit a114bd1204
12 changed files with 108 additions and 9 deletions
+8 -1
View File
@@ -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;
+2 -2
View File
@@ -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)
+1
View File
@@ -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),
+7
View File
@@ -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;
};
}
}
+10 -1
View File
@@ -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;