mirror of
https://github.com/sqlitebrowser/sqlitebrowser.git
synced 2026-01-21 03:21:43 -06:00
Added text alignment to conditional formats
Combo box for selecting the desired text alignment for a conditional format. The default alignment in the browser has been adjusted for numbers, which are now aligned to the right as in spreadsheets. Project file format updated. See issues #1976 and #1815.
This commit is contained in:
@@ -2252,10 +2252,16 @@ static void loadBrowseDataTableSettings(BrowseDataTableSettings& settings, QXmlS
|
||||
else
|
||||
Settings::getValue("databrowser", "font").toString();
|
||||
|
||||
CondFormat::Alignment align;
|
||||
if (xml.attributes().hasAttribute("align"))
|
||||
align = static_cast<CondFormat::Alignment>(xml.attributes().value("align").toInt());
|
||||
else
|
||||
align = CondFormat::AlignLeft;
|
||||
|
||||
settings.condFormats[index].emplace_back(xml.attributes().value("condition").toString(),
|
||||
QColor(xml.attributes().value("foreground").toString()),
|
||||
QColor(xml.attributes().value("background").toString()),
|
||||
font, settings.encoding);
|
||||
font, align, settings.encoding);
|
||||
xml.skipCurrentElement();
|
||||
}
|
||||
}
|
||||
@@ -2594,6 +2600,7 @@ static void saveBrowseDataTableSettings(const BrowseDataTableSettings& object, Q
|
||||
xml.writeAttribute("background", format.backgroundColor().name());
|
||||
xml.writeAttribute("foreground", format.foregroundColor().name());
|
||||
xml.writeAttribute("font", format.font().toString());
|
||||
xml.writeAttribute("align", QString().setNum(format.alignment()));
|
||||
xml.writeEndElement();
|
||||
}
|
||||
xml.writeEndElement();
|
||||
|
||||
Reference in New Issue
Block a user