Skip to content

Commit

Permalink
fix: Calculate bottom of display for position 'bottom'
Browse files Browse the repository at this point in the history
  • Loading branch information
cmacrae committed Jul 16, 2020
1 parent 1733208 commit 4fd4bb1
Show file tree
Hide file tree
Showing 4 changed files with 23 additions and 6 deletions.
16 changes: 16 additions & 0 deletions CHANGELOG.md
Original file line number Diff line number Diff line change
Expand Up @@ -7,3 +7,19 @@ This project adheres to [Semantic Versioning](https://semver.org/spec/v2.0.0.htm
## [Unreleased]

[Unreleased]: https://github.com/cmacrae/spacebar/compare/master...HEAD

## [1.0.0]() - 2020-07-16

**Added**
- Option to position at the top or bottom of the screen
- Individual colour settings for each icon in the right strip (`dnd`, `power`, `clock`)
- DoNotDisturb indicator

**Changed**
- Current space indicated by colouring the glyph
- Removal of underlines
- Fixed flicker bug when changing monitor focus (thanks [@tom-auger](https://github.com/tom-auger))

## Pre-1.0.0
This changelog was not kept up to date prior to `1.0.0`.
See the commit log for more information.
2 changes: 1 addition & 1 deletion README.md
Original file line number Diff line number Diff line change
Expand Up @@ -15,7 +15,7 @@
<a href="https://builtwithnix.org">
<img src="https://img.shields.io/badge/Built_With-Nix-5277C3.svg?logo=nixos&labelColor=73C3D5" alt="Nix Badge">
</a>
<a href="https://github.com/cmacrae/spacebar/compare/v0.5.0...HEAD">
<a href="https://github.com/cmacrae/spacebar/compare/v1.0.0...HEAD">
<img src="https://img.shields.io/github/commits-since/cmacrae/spacebar/latest.svg?color=orange" alt="Version Badge">
</a>
</p>
Expand Down
7 changes: 4 additions & 3 deletions src/bar.c
Original file line number Diff line number Diff line change
Expand Up @@ -368,13 +368,14 @@ static CGPoint bar_create_frame(struct bar *bar, CFTypeRef *frame_region)
CGPoint origin = bounds.origin;

if (!display_manager_menu_bar_hidden()) {
CGRect menu = display_manager_menu_bar_rect(bar->did);
origin.y += menu.size.height;
CGRect menu = display_manager_menu_bar_rect(bar->did);
origin.y += menu.size.height;
}

char *btm = "bottom";
CGFloat display_bottom = CGRectGetMaxY(bounds);
if (strcmp(g_bar_manager.position, btm) == 0) {
origin.y = bounds.size.height - 26;
origin.y = display_bottom - 26;
}

bar->frame = (CGRect) {{0, 0},{bounds.size.width, 26}};
Expand Down
4 changes: 2 additions & 2 deletions src/spacebar.c
Original file line number Diff line number Diff line change
Expand Up @@ -11,8 +11,8 @@
#define CONFIG_OPT_LONG "--config"
#define CONFIG_OPT_SHRT "-c"

#define MAJOR 0
#define MINOR 4
#define MAJOR 1
#define MINOR 0
#define PATCH 0

extern int SLSMainConnectionID(void);
Expand Down

0 comments on commit 4fd4bb1

Please sign in to comment.