Skip to content
This repository has been archived by the owner on Dec 15, 2022. It is now read-only.

Add font resizing in project search (#21125) #1153

Open
wants to merge 1 commit into
base: master
Choose a base branch
from

Conversation

dawidowoc
Copy link

@dawidowoc dawidowoc commented May 9, 2021

Requirements

  • Filling out the template is required. Any pull request that does not include enough information to be reviewed in a timely manner may be closed at the maintainers' discretion.
  • All new code requires tests to ensure against regressions

Description of the Change

Add possibility to change font size in project find results view. The font size is connected to editor.fontSize property. It can be changed by using window:increase-font-size, window:decrease-font-size, window:reset-font-size commands, similarly as you can do for editor view.

Video presenting the feature: https://youtu.be/fqGRfRE3b6M

Alternate Designs

I don't see any alternate designs.

Benefits

Possibility to change font size in project find results view.

Possible Drawbacks

I don't see any.

Applicable Issues

atom/atom#21125

@dawidowoc dawidowoc force-pushed the feature/font-resize-in-project-search branch from 5ddb65a to f300227 Compare May 9, 2021 11:58

getHeightAdjustedToFontSize(baseHeight) {
const lineHeight = 2;
const baseFontSize = 12;
Copy link
Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

12 was the default font size before my changes. I'm treating it as base size for height calculation because some of the existing stylings seems to depend on this value.

}

getHeightAdjustedToFontSize(baseHeight) {
const lineHeight = 2;
Copy link
Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Value of line-height for items in project find results is equal to 2em. That's why we need to keep this multiplier when increasing/decreasing font size.

@@ -54,18 +70,20 @@ module.exports = class ListView {
children.push(
$.div(
{
className: "item-container",
Copy link
Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Needed for selection during test only.

@@ -374,3 +374,7 @@ atom-workspace.find-visible {
}
}
}

.list-tree.has-collapsable-children .list-nested-item > .list-item::before {
vertical-align: middle;
Copy link
Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

It's related to that arrow icon showing that you can expand a nested item. We want them to keep it in the middle (vertically) at all times when you change the font size.

Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

1 participant