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

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

Closed
dawidowoc wants to merge 1 commit into
atom:masterfrom
dawidowoc:feature/font-resize-in-project-search
Closed

Add font resizing in project search (#21125)#1153
dawidowoc wants to merge 1 commit into
atom:masterfrom
dawidowoc:feature/font-resize-in-project-search

Conversation

@dawidowoc

@dawidowoc dawidowoc commented May 9, 2021

Copy link
Copy Markdown

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


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

Copy link
Copy Markdown
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
Copy Markdown
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.

Comment thread lib/project/list-view.js
children.push(
$.div(
{
className: "item-container",

Copy link
Copy Markdown
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.

}

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

Copy link
Copy Markdown
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.

@dawidowoc dawidowoc closed this by deleting the head repository Jan 19, 2025
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