--- a/hedgewars/uFLGameConfig.pas Wed Nov 25 22:10:01 2015 +0300
+++ b/hedgewars/uFLGameConfig.pas Thu Nov 26 20:11:54 2015 +0300
@@ -336,7 +336,9 @@
if seed <> currentConfig.seed then
begin
currentConfig.seed:= seed;
- sendUI(mtSeed, @seed[1], length(seed))
+ sendUI(mtSeed, @seed[1], length(seed));
+
+ getPreview()
end
end;
--- a/qmlFrontend/qml/qmlFrontend/GameConfig.qml Wed Nov 25 22:10:01 2015 +0300
+++ b/qmlFrontend/qml/qmlFrontend/GameConfig.qml Thu Nov 26 20:11:54 2015 +0300
@@ -55,6 +55,11 @@
HWEngine.setTheme(themeName.text)
}
}
+
+ Connections {
+ target: HWEngine
+ onThemeChanged: cbTheme.showItem({"iconSource" : "image://theme/" + theme, "text" : theme});
+ }
}
}
@@ -85,6 +90,10 @@
HWEngine.setScript(scriptName.text)
}
}
+ Connections {
+ target: HWEngine
+ onScriptChanged: scriptsModel.showItem({"iconSource" : "", "text" : script});
+ }
}
}
--- a/qmlFrontend/qml/qmlFrontend/HWComboBox.qml Wed Nov 25 22:10:01 2015 +0300
+++ b/qmlFrontend/qml/qmlFrontend/HWComboBox.qml Thu Nov 26 20:11:54 2015 +0300
@@ -54,5 +54,10 @@
}
}
+ function showItem(item) {
+ cbIcon.source = item.iconSource
+ cbText.text = item.text
+ }
+
onClicked: selection.visibility = Window.Windowed
}
--- a/qmlFrontend/themeiconprovider.cpp Wed Nov 25 22:10:01 2015 +0300
+++ b/qmlFrontend/themeiconprovider.cpp Thu Nov 26 20:11:54 2015 +0300
@@ -28,9 +28,9 @@
char * bufptr = buf.data();
uint32_t fileSize = getThemeIcon(id.toUtf8().data(), bufptr, buf.size());
buf.truncate(fileSize);
- qDebug() << "ThemeIconProvider file size = " << fileSize;
+ //qDebug() << "ThemeIconProvider file size = " << fileSize;
- QImage img = QImage::fromData(buf);
+ QImage img = fileSize ? QImage::fromData(buf) : QImage(16, 16, QImage::Format_ARGB32);
if (size)
*size = img.size();