dbordak / telephone-line

A new implementation of Powerline for Emacs
GNU General Public License v3.0
550 stars 51 forks source link

active and inactive are inverted for `telephone-line-accent` #89

Closed francesco-cadei closed 5 years ago

francesco-cadei commented 5 years ago

telephone-line-accent-inactive and telephone-line-accent-active are inverted

dbordak commented 5 years ago

They aren't normally. I'll need more information; what's your config?

francesco-cadei commented 5 years ago

My config:

     (setq-default telephone-line-primary-left-separator 'telephone-line-identity-right
                   telephone-line-primary-right-separator 'telephone-line-identity-left
                   telephone-line-secondary-left-separator 'telephone-line-identity-hollow-right
                   telephone-line-secondary-right-separator 'telephone-line-identity-hollow-left)

     (custom-set-faces
      '(mode-line-inactive
        ((t (:foreground "grey70" :background "grey17" :box nil))))
      '(mode-line
        ((t (:foreground "grey70" :background "grey22" :box nil))))
      '(telephone-line-accent-active
        ((t (:foreground "grey85" :background "grey6" :box nil))))
      '(telephone-line-accent-inactive
        ((t (:foreground "grey85" :background "grey6" :box nil)))))

     (setq-default telephone-line-faces 
                   '((accent . (telephone-line-accent-inactive . telephone-line-accent-active))
                     (nil . (mode-line . mode-line-inactive))))

     (setq-default telephone-line-lhs 
                   '((accent . (telephone-line-vc-segment))
                     (nil . (telephone-line-buffer-segment))))
     (setq-default telephone-line-rhs
                   '((nil . (telephone-line-misc-info-segment
                             telephone-line-major-mode-segment))
                     (accent . (telephone-line-minor-mode-segment
                                telephone-line-position-segment))))

     (telephone-line-mode)

Note that I have setted (accent . (telephone-line-accent-inactive . telephone-line-accent-active)

dbordak commented 5 years ago

Yeah, that last line is what inverts it -- the first item in the cons should be the active face. Or are you saying that's your fix for it being inverted already?

You defined the same face for both of them, so I'm not sure what you mean by inverted -- there'd be no way to see if they were swapped. The foreground and background aren't inverted either, here's a pic of describe-face for me 2018-10-24-094649_3200x1800_scrot

francesco-cadei commented 5 years ago

It is my workaround to fix the inverted default behavior.

dbordak commented 5 years ago

You don't have any difference between active and inactive in your config (you defined the same face), so how would you know if it's inverted?

dbordak commented 5 years ago

I just tried a basic config; I used this init.el in its entirety:


(add-to-list 'load-path "~/repos/telephone-line")
(require 'telephone-line)
(setq-default telephone-line-primary-left-separator 'telephone-line-identity-right
              telephone-line-primary-right-separator 'telephone-line-identity-left
              telephone-line-secondary-left-separator 'telephone-line-identity-hollow-right
              telephone-line-secondary-right-separator 'telephone-line-identity-hollow-left)

(custom-set-faces
 '(mode-line-inactive
   ((t (:foreground "grey70" :background "grey17" :box nil))))
 '(mode-line
   ((t (:foreground "grey70" :background "grey22" :box nil))))
 '(telephone-line-accent-active
   ((t (:foreground "red" :background "grey6" :box nil))))
 '(telephone-line-accent-inactive
   ((t (:foreground "blue" :background "grey6" :box nil)))))

(setq-default telephone-line-faces
              '((accent . (telephone-line-accent-inactive . telephone-line-accent-active))
                (nil . (mode-line . mode-line-inactive))))

(setq-default telephone-line-lhs
              '((accent . (telephone-line-vc-segment))
                (nil . (telephone-line-buffer-segment))))
(setq-default telephone-line-rhs
              '((nil . (telephone-line-misc-info-segment
                        telephone-line-major-mode-segment))
                (accent . (telephone-line-minor-mode-segment
                           telephone-line-position-segment))))

(telephone-line-mode)

So, if your fix works, you'd expect the active window to have red text, and the inactive window to have blue text. However, this is the result produced:

2018-10-24-105002_3200x1800_scrot

So the default behavior is working correctly and the fix inverts it on its own. Do you have something else in your init that could be causing this issue?

francesco-cadei commented 5 years ago

Ya, sorry for the time. You are right I have another line in the init.

dbordak commented 5 years ago

No problem, glad to help!