Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Couple of small fixes: add a link to the buffer view documents, change the buffer viewer error style for dark mode #3131

Merged
merged 2 commits into from
Nov 16, 2023
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
2 changes: 1 addition & 1 deletion docs/how/how_buffer_format.rst
Original file line number Diff line number Diff line change
Expand Up @@ -162,7 +162,7 @@ The buffer format supports annotations on declarations to specify special proper
Struct definitions support the following annotations:

* ``[[size(number)]]`` or ``[[byte_size(number)]]`` - Forces the struct to be padded up to a given size even if the contents don't require it.
* ``[[single]]`` or ``[[fixed]]`` - Forces the struct to be considered as a fixed SoA definition, even if in context the buffer viewer may default to AoS. See the below section for more details. Structs with this annotation **may not** be declared as a variable, and should instead be the implicit final struct in a definition.
* ``[[single]]`` or ``[[fixed]]`` - Forces the struct to be considered as a fixed SoA definition, even if in context the buffer viewer may default to AoS. See :ref:`the below section <aos-soa>` for more details. Structs with this annotation **may not** be declared as a variable, and should instead be the implicit final struct in a definition.

Variable declarations support the following annotations:

Expand Down
8 changes: 6 additions & 2 deletions qrenderdoc/Widgets/BufferFormatSpecifier.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -86,9 +86,13 @@ BufferFormatSpecifier::BufferFormatSpecifier(QWidget *parent)

QColor base = formatText->palette().color(QPalette::Base);

QColor col = QColor::fromHslF(0.0f, 1.0f, qBound(0.1, base.lightnessF(), 0.9));
QColor backCol = QColor::fromHslF(0.0f, 1.0f, qBound(0.1, base.lightnessF(), 0.9));
QColor foreCol = contrastingColor(backCol, QColor(0, 0, 0));

formatText->styleSetBack(ERROR_STYLE, SCINTILLA_COLOUR(col.red(), col.green(), col.blue()));
formatText->styleSetBack(ERROR_STYLE,
SCINTILLA_COLOUR(backCol.red(), backCol.green(), backCol.blue()));
formatText->styleSetFore(ERROR_STYLE,
SCINTILLA_COLOUR(foreCol.red(), foreCol.green(), foreCol.blue()));

ConfigureSyntax(formatText, SCLEX_BUFFER);

Expand Down