forked from Mudlet/Mudlet
-
Notifications
You must be signed in to change notification settings - Fork 0
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Merge branch 'development' into development
- Loading branch information
Showing
24 changed files
with
413 additions
and
305 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
|
@@ -4,7 +4,7 @@ | |
/*************************************************************************** | ||
* Copyright (C) 2008-2013 by Heiko Koehn - [email protected] * | ||
* Copyright (C) 2014 by Ahmed Charles - [email protected] * | ||
* Copyright (C) 2015-2020, 2022-2023 by Stephen Lyons * | ||
* Copyright (C) 2015-2020, 2022-2024 by Stephen Lyons * | ||
* - [email protected] * | ||
* Copyright (C) 2016 by Ian Adkins - [email protected] * | ||
* Copyright (C) 2018 by Huadong Qi - [email protected] * | ||
|
@@ -706,6 +706,17 @@ class Host : public QObject | |
// shortcut to switch between the input line and the main window | ||
CaretShortcut mCaretShortcut = CaretShortcut::None; | ||
|
||
// Support a long-standing hack among all clients for using the <SGR>1m | ||
// Bold) code to select a set of brighter 8 colors (the second eight) from | ||
// the 256 colors for "16 color" mode of operation - alongside the basic | ||
// <SGR>30m (Black) to <SGR>37m (White) set of codes. Using the "AIXTERM" | ||
// codes (<SGR>90m to <SGR>97m) codes or the <SGR>38::5:Nm ones are later | ||
// (better) ways of accessing that second set of 8 but some Servers only | ||
// know the first for 16 color operation. The prior behaviour for Mudlet | ||
// would be almost equivalent to this option being true but it limits the | ||
// ability to have completely separate bold (and faint) font weightings: | ||
bool mBoldIsBright = true; | ||
|
||
signals: | ||
// Tells TTextEdit instances for this profile how to draw the ambiguous | ||
// width characters: | ||
|
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,7 +1,8 @@ | ||
/*************************************************************************** | ||
* Copyright (C) 2008-2013 by Heiko Koehn - [email protected] * | ||
* Copyright (C) 2014-2017 by Ahmed Charles - [email protected] * | ||
* Copyright (C) 2014-2020 by Stephen Lyons - [email protected] * | ||
* Copyright (C) 2014-2020, 2023-2024 by Stephen Lyons * | ||
* - [email protected] * | ||
* Copyright (C) 2022 by Thiago Jung Bauermann - [email protected] * | ||
* * | ||
* This program is free software; you can redistribute it and/or modify * | ||
|
@@ -388,17 +389,33 @@ QString TAccessibleTextEdit::attributes(int offset, int *startOffset, int *endOf | |
const TChar &charStyle = textEdit()->mpBuffer->buffer.at(line).at(column); | ||
// IAccessible2's text attributes don't support the overline attribute. | ||
const TChar::AttributeFlags attributes = charStyle.allDisplayAttributes(); | ||
const bool isBold = (attributes & TChar::Bold) || font.weight() > QFont::Normal; | ||
// According to | ||
// https://wiki.linuxfoundation.org/accessibility/iaccessible2/textattributes | ||
// only the names "normal" and "bold" are supported alongside the numeric | ||
// values as explained in | ||
// https://www.w3.org/TR/CSS21/fonts.html#font-boldness : | ||
#if QT_VERSION < QT_VERSION_CHECK(6, 0, 0) | ||
const int fontWeight = (attributes & TChar::Bold) ? ((attributes & TChar::Faint) ? TBuffer::csmCssFontWeight_boldAndFaint | ||
: TBuffer::csmCssFontWeight_bold) | ||
: ((attributes & TChar::Faint) ? TBuffer::csmCssFontWeight_faint | ||
: TBuffer::csmCssFontWeight_normal); | ||
#else | ||
const int fontWeight = (attributes & TChar::Bold) ? ((attributes & TChar::Faint) ? TBuffer::csmFontWeight_boldAndFaint | ||
: TBuffer::csmFontWeight_bold) | ||
: ((attributes & TChar::Faint) ? TBuffer::csmFontWeight_faint | ||
: TBuffer::csmFontWeight_normal); | ||
#endif | ||
const bool isItalics = (attributes & TChar::Italic) || style == QFont::StyleItalic; | ||
const bool isStrikeOut = attributes & TChar::StrikeOut; | ||
const bool isUnderline = attributes & TChar::Underline; | ||
const bool isReverse = attributes & TChar::Reverse; | ||
const bool caretIsHere = textEdit()->mpHost->caretEnabled() && textEdit()->mCaretLine == line && | ||
textEdit()->mCaretColumn == column; | ||
|
||
// Different weight values are not handled. | ||
if (isBold) { | ||
ret += "font-weight:bold;"; | ||
if (fontWeight != 400) { | ||
// 400 is the "normal" value however we might not have defined ours to | ||
// be that: | ||
ret += "font-weight:" + QString::number(fontWeight) + ";"; | ||
} | ||
if (isItalics || style != QFont::StyleNormal) { | ||
ret += "font-style:" + QString::fromLatin1(isItalics ? "italic;" : "oblique;"); | ||
|
Oops, something went wrong.