ui: overlay window base size
* added property in application settings to define a basic width and height that is used when creating new overlay windows. * fixed crash in tests
This commit is contained in:
@@ -2,6 +2,8 @@
|
||||
<config>
|
||||
<application>
|
||||
<indexer_thread_count>4</indexer_thread_count>
|
||||
<window_base_width>500</window_base_width>
|
||||
<window_base_height>500</window_base_height>
|
||||
</application>
|
||||
<user>
|
||||
<recent_projects>
|
||||
|
||||
@@ -30,6 +30,8 @@
|
||||
<font_size_min><!-- INTEGER: minimum font size in pt --></font_size_min>
|
||||
<font_size_std><!-- INTEGER: standard font size in pt --></font_size_std>
|
||||
<indexer_thread_count><!-- INTEGER: number of threads indexing the source code --></indexer_thread_count>
|
||||
<window_base_width><!-- INTEGER: initial width of an overlay window --></window_base_width>
|
||||
<window_base_height><!-- INTEGER: initial height of an overlay window --></window_base_height>
|
||||
</application>
|
||||
|
||||
<code>
|
||||
|
||||
@@ -153,6 +153,16 @@ void ApplicationSettings::setIndexerThreadCount(const int count)
|
||||
setValue<int>("application/indexer_thread_count", count);
|
||||
}
|
||||
|
||||
int ApplicationSettings::getWindowBaseWidth() const
|
||||
{
|
||||
return getValue<int>("application/window_base_width", 500);
|
||||
}
|
||||
|
||||
int ApplicationSettings::getWindowBaseHeight() const
|
||||
{
|
||||
return getValue<int>("application/window_base_height", 500);
|
||||
}
|
||||
|
||||
int ApplicationSettings::getCodeTabWidth() const
|
||||
{
|
||||
return getValue<int>("code/tab_width", 4);
|
||||
|
||||
@@ -50,6 +50,9 @@ public:
|
||||
int getIndexerThreadCount() const;
|
||||
void setIndexerThreadCount(const int count);
|
||||
|
||||
int getWindowBaseWidth() const;
|
||||
int getWindowBaseHeight() const;
|
||||
|
||||
// code
|
||||
int getCodeTabWidth() const;
|
||||
void setCodeTabWidth(int codeTabWidth);
|
||||
|
||||
@@ -8,6 +8,7 @@
|
||||
|
||||
#include "qt/utility/QtDeviceScaledPixmap.h"
|
||||
#include "qt/utility/utilityQt.h"
|
||||
#include "settings/ApplicationSettings.h"
|
||||
#include "utility/ResourcePaths.h"
|
||||
|
||||
QtWindow::QtWindow(QWidget* parent)
|
||||
@@ -56,7 +57,10 @@ QtWindow::QtWindow(QWidget* parent)
|
||||
|
||||
QSize QtWindow::sizeHint() const
|
||||
{
|
||||
return QSize(500, 500);
|
||||
return QSize(
|
||||
ApplicationSettings::getInstance()->getWindowBaseWidth(),
|
||||
ApplicationSettings::getInstance()->getWindowBaseHeight()
|
||||
);
|
||||
}
|
||||
|
||||
void QtWindow::setup()
|
||||
|
||||
@@ -233,11 +233,6 @@ private:
|
||||
clear();
|
||||
}
|
||||
|
||||
~TestStorage()
|
||||
{
|
||||
boost::filesystem::remove("data/test.sqlite");
|
||||
}
|
||||
|
||||
std::shared_ptr<TokenLocationCollection> getLocationCollectionForTokenId(Id id) const
|
||||
{
|
||||
std::vector<Id> tokenIds;
|
||||
|
||||
Reference in New Issue
Block a user