Skip to content

Commit

Permalink
Corrected tab stop distance.
Browse files Browse the repository at this point in the history
  • Loading branch information
tsujan committed Nov 27, 2022
1 parent 0f45109 commit 658f50e
Show file tree
Hide file tree
Showing 41 changed files with 5,411 additions and 5,407 deletions.
1 change: 1 addition & 0 deletions ChangeLog
Original file line number Diff line number Diff line change
Expand Up @@ -3,6 +3,7 @@ V1.1.0
* Fixed crash on pasting with empty clipboard.
* Fixed a bug in updating widget states after deleting a node.
* Fixed text zooming for documents that are saved by the Qt6 version.
* Corrected the tab stop distance.
* Added a workaround for a Qt bug related to the current character format.
* Added a real Unix signal handler.
* Removed "Embed Image" from the toolbar to make it uncluttered.
Expand Down
2 changes: 1 addition & 1 deletion NEWS
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
Latest version:

26 Nov 2022, V1.1.0
27 Nov 2022, V1.1.0

See "ChangeLog" for changes.
292 changes: 146 additions & 146 deletions feathernotes/data/translations/feathernotes.ts

Large diffs are not rendered by default.

292 changes: 146 additions & 146 deletions feathernotes/data/translations/feathernotes_ar_DZ.ts

Large diffs are not rendered by default.

292 changes: 146 additions & 146 deletions feathernotes/data/translations/feathernotes_be.ts

Large diffs are not rendered by default.

292 changes: 146 additions & 146 deletions feathernotes/data/translations/feathernotes_bg.ts

Large diffs are not rendered by default.

292 changes: 146 additions & 146 deletions feathernotes/data/translations/feathernotes_ca.ts

Large diffs are not rendered by default.

292 changes: 146 additions & 146 deletions feathernotes/data/translations/feathernotes_cs.ts

Large diffs are not rendered by default.

292 changes: 146 additions & 146 deletions feathernotes/data/translations/feathernotes_cy.ts

Large diffs are not rendered by default.

292 changes: 146 additions & 146 deletions feathernotes/data/translations/feathernotes_da.ts

Large diffs are not rendered by default.

292 changes: 146 additions & 146 deletions feathernotes/data/translations/feathernotes_de.ts

Large diffs are not rendered by default.

292 changes: 146 additions & 146 deletions feathernotes/data/translations/feathernotes_el.ts

Large diffs are not rendered by default.

292 changes: 146 additions & 146 deletions feathernotes/data/translations/feathernotes_eo.ts

Large diffs are not rendered by default.

292 changes: 146 additions & 146 deletions feathernotes/data/translations/feathernotes_es.ts

Large diffs are not rendered by default.

292 changes: 146 additions & 146 deletions feathernotes/data/translations/feathernotes_et.ts

Large diffs are not rendered by default.

292 changes: 146 additions & 146 deletions feathernotes/data/translations/feathernotes_fa.ts

Large diffs are not rendered by default.

292 changes: 146 additions & 146 deletions feathernotes/data/translations/feathernotes_fi.ts

Large diffs are not rendered by default.

292 changes: 146 additions & 146 deletions feathernotes/data/translations/feathernotes_fr.ts

Large diffs are not rendered by default.

292 changes: 146 additions & 146 deletions feathernotes/data/translations/feathernotes_he.ts

Large diffs are not rendered by default.

292 changes: 146 additions & 146 deletions feathernotes/data/translations/feathernotes_hr.ts

Large diffs are not rendered by default.

292 changes: 146 additions & 146 deletions feathernotes/data/translations/feathernotes_hu.ts

Large diffs are not rendered by default.

292 changes: 146 additions & 146 deletions feathernotes/data/translations/feathernotes_id.ts

Large diffs are not rendered by default.

292 changes: 146 additions & 146 deletions feathernotes/data/translations/feathernotes_it.ts

Large diffs are not rendered by default.

292 changes: 146 additions & 146 deletions feathernotes/data/translations/feathernotes_ja.ts

Large diffs are not rendered by default.

292 changes: 146 additions & 146 deletions feathernotes/data/translations/feathernotes_ko.ts

Large diffs are not rendered by default.

292 changes: 146 additions & 146 deletions feathernotes/data/translations/feathernotes_lt.ts

Large diffs are not rendered by default.

292 changes: 146 additions & 146 deletions feathernotes/data/translations/feathernotes_nb_NO.ts

Large diffs are not rendered by default.

292 changes: 146 additions & 146 deletions feathernotes/data/translations/feathernotes_nl.ts

Large diffs are not rendered by default.

292 changes: 146 additions & 146 deletions feathernotes/data/translations/feathernotes_pl.ts

Large diffs are not rendered by default.

292 changes: 146 additions & 146 deletions feathernotes/data/translations/feathernotes_pt.ts

Large diffs are not rendered by default.

292 changes: 146 additions & 146 deletions feathernotes/data/translations/feathernotes_pt_BR.ts

Large diffs are not rendered by default.

292 changes: 146 additions & 146 deletions feathernotes/data/translations/feathernotes_ru.ts

Large diffs are not rendered by default.

292 changes: 146 additions & 146 deletions feathernotes/data/translations/feathernotes_si.ts

Large diffs are not rendered by default.

292 changes: 146 additions & 146 deletions feathernotes/data/translations/feathernotes_sk_SK.ts

Large diffs are not rendered by default.

292 changes: 146 additions & 146 deletions feathernotes/data/translations/feathernotes_sv.ts

Large diffs are not rendered by default.

292 changes: 146 additions & 146 deletions feathernotes/data/translations/feathernotes_tr.ts

Large diffs are not rendered by default.

292 changes: 146 additions & 146 deletions feathernotes/data/translations/feathernotes_uk.ts

Large diffs are not rendered by default.

292 changes: 146 additions & 146 deletions feathernotes/data/translations/feathernotes_zh_CN.ts

Large diffs are not rendered by default.

292 changes: 146 additions & 146 deletions feathernotes/data/translations/feathernotes_zh_HANT.ts

Large diffs are not rendered by default.

9 changes: 6 additions & 3 deletions feathernotes/fn.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -783,7 +783,10 @@ void FN::unZooming()

TextEdit *textEdit = qobject_cast<TextEdit*>(cw);
textEdit->setFont (defaultFont_);
QFontMetricsF metrics (defaultFont_);
/* WARNING: defaultFont_ shouldn't be used below because, as Qt doc explains,
the properties of defaultFont_ are combined with the widget's
default font to form the widget's final font. */
QFontMetricsF metrics (textEdit->font());
textEdit->setTabStopDistance (4 * metrics.horizontalAdvance (' '));

/* this may be a zoom-out */
Expand Down Expand Up @@ -2033,7 +2036,7 @@ TextEdit *FN::newWidget()
/* we want consistent widgets */
textEdit->setFont (defaultFont_); // needed when the application font changes
textEdit->document()->setDefaultFont (defaultFont_);
QFontMetricsF metrics (defaultFont_);
QFontMetricsF metrics (textEdit->font()); // see unZooming()
textEdit->setTabStopDistance (4 * metrics.horizontalAdvance (' '));

int index = ui->stackedWidget->currentIndex();
Expand Down Expand Up @@ -3196,7 +3199,7 @@ void FN::textFontDialog()
QTextCursor cursor = it.value()->textCursor();
cursor.select (QTextCursor::Document);
cursor.mergeCharFormat (fmt);
QFontMetricsF metrics (defaultFont_);
QFontMetricsF metrics (it.value()->font()); // see unZooming()
it.value()->setTabStopDistance (4 * metrics.horizontalAdvance (' '));
}

Expand Down
2 changes: 1 addition & 1 deletion feathernotes/textedit.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -1108,7 +1108,7 @@ void TextEdit::zooming (float range)
if (newSize <= 0) return;
f.setPointSizeF (static_cast<qreal>(newSize));
setFont (f);
QFontMetricsF metrics (f);
QFontMetricsF metrics (font()); // see FN::unZooming()
setTabStopDistance (4 * metrics.horizontalAdvance (' '));

/* if this is a zoom-out, the text will need
Expand Down

0 comments on commit 658f50e

Please sign in to comment.