Old sprites removed completely. Only #rrggbb and #rrggbbaa in styles.

Also moved Checkbox and Radiobutton to Ui namespace.
Also child widgets in many boxes were wrapped in ChildWidget<>.
This commit is contained in:
John Preston
2016-10-28 12:20:24 +03:00
parent 42e544abff
commit 2e4426aac0
70 changed files with 876 additions and 1726 deletions
@@ -25,7 +25,6 @@ Copyright (c) 2014-2016 John Preston, https://desktop.telegram.org
#include "codegen/common/cpp_file.h"
#include "codegen/style/parsed_file.h"
#include "codegen/style/generator.h"
#include "codegen/style/sprite_generator.h"
namespace codegen {
namespace style {
@@ -66,38 +65,28 @@ int Processor::launch() {
bool Processor::write(const structure::Module &module) const {
bool forceReGenerate = false;
bool onlyStyles = options_.skipSprites;
bool onlySprites = options_.skipStyles;
if (!onlyStyles) {
SpriteGenerator spriteGenerator(module, forceReGenerate);
if (!spriteGenerator.writeSprites()) {
return false;
}
QDir dir(options_.outputPath);
if (!dir.mkpath(".")) {
common::logError(kErrorCantWritePath, "Command Line") << "can not open path for writing: " << dir.absolutePath().toStdString();
return false;
}
if (!onlySprites) {
QDir dir(options_.outputPath);
if (!dir.mkpath(".")) {
common::logError(kErrorCantWritePath, "Command Line") << "can not open path for writing: " << dir.absolutePath().toStdString();
return false;
}
QFileInfo srcFile(module.filepath());
QString dstFilePath = dir.absolutePath() + '/' + destFileBaseName(module);
QFileInfo srcFile(module.filepath());
QString dstFilePath = dir.absolutePath() + '/' + destFileBaseName(module);
common::ProjectInfo project = {
"codegen_style",
srcFile.fileName(),
"stdafx.h",
forceReGenerate
};
common::ProjectInfo project = {
"codegen_style",
srcFile.fileName(),
"stdafx.h",
forceReGenerate
};
Generator generator(module, dstFilePath, project);
if (!generator.writeHeader()) {
return false;
}
if (!generator.writeSource()) {
return false;
}
Generator generator(module, dstFilePath, project);
if (!generator.writeHeader()) {
return false;
}
if (!generator.writeSource()) {
return false;
}
return true;
}