howl-editor / howl

The Howl Editor
http://howl.io
Other
712 stars 68 forks source link

Window overflows in Elementary OS Freya #200

Closed finnbar closed 8 years ago

finnbar commented 8 years ago

I don't know whether this is some weird Elementary OS thing, but whatever theme is set, the window seems to overflow to outside of the window controls. The window controls are still within the inside bit as well, it just seems to have some extra stuff on the outside. I've attached an image showing this.

screenshot from 2016-05-31 20 07 49

Sorry if this is an easily fixable user setting rather than an actual bug, I've just picked up Howl (and it's super nice!) and cloned it from the repo.

nilnor commented 8 years ago

(I'm assuming you refer to the window's title bar extending past Howl's editor view - please correct me if I'm wrong).

This is not actually a bug per se, but a theming setting. The outer padding is an option in themes (defaulting to a little bit of padding), which typically works out well. For your setup not so much however since in this case a full width would blend in better (nice screenshot by the way).

It's unfortunately not an easily fixable user setting at this point. At some point in the future we'll add easy theme overriding, but until this is in place it's slightly more work to customize a theme. For this example (customizing the Monokai theme) you can do the following:

  window:
    outer_padding: 0
howl.ui.theme.register('Monokai Custom', user_file('monokai-custom.moon'))
howl.config.theme = 'Monokai Custom

Let me know how it works out for you!

refi64 commented 8 years ago

@nilnor I thought the issue was referring to the giant black box outside of the window?

finnbar commented 8 years ago

@kirbyfan64 Yes, I was referring to the black box, although I'm going to try @nilnor 's fix. Weirdly when opening a file in Howl by right-clicking in Files and selecting "open with Howl", the box disappears. I've got no idea what's happening there, but I'll report back on trying the fix.

nilnor commented 8 years ago

@finnbar All right, so that's weird then (and in that case you can ignore the other suggestion). That padding is completely outside of the entire actual window (including the window decorations). How does it look with other themes, is the padding always black or does it change with themes?

finnbar commented 8 years ago

@nilnor The padding matches the theme seamlessly. Here's another nice screenshot:

screenshot from 2016-05-31 21 00 58

nilnor commented 8 years ago

Some searching indicates this might be a fairly common problem with Gtk3 apps and certain window managers. See for instance https://github.com/numixproject/numix-gtk-theme/issues/206 and http://www.webupd8.org/2015/11/fix-large-black-borders-around-header.html.

They talk about work-arounds with overriding Gtk style settings in the home dir, so you could try that and it might fix it. However, I would like to know if this is something we can work around directly in Howl as well, so if you have the time it would be great if you could try modifying the lib/howl/ui/theme.moon file in Howl and add the following within the css_template definition:

.window-frame {
  box-shadow: none;
  margin: 0;
}

Either edit the file with Howl itself, or run make again in the scr directory afterwards, and see if that has any effect?

finnbar commented 8 years ago

That makes sense, thank you for taking your time to work out what's going on! I added that to the definition then remade Howl, then a few weird things happened. I also undid the change, and the same weird things happened.

If I run howl either by clicking its executable or when I right-click a file in my file manager and select "Open with Howl", it works perfectly and the box doesn't appear. If I run the command "howl" in the terminal or click its .desktop file (which just runs "howl"), the weird box appears. Is there anything in the make install that would cause stuff to be weird like this?

finnbar commented 8 years ago

I think for now I'll just modify the .desktop to go with my user's executable (rather than the one created by sudo make install) as a temporary fix, but I'll keep an eye out. Thank you for all of your help!

EDIT: Pantheon Files must be doing something, because that didn't fix it. I'll keep looking into it.

finnbar commented 8 years ago

Okay, you're magic. This works a treat! I have no idea what was happening before, but it's all working now. I must have missed a make or sudo make install somewhere.

nilnor commented 8 years ago

@finnbar Excellent, that's exactly what I want to hear before going to bed :)

Just to be clear, this was the addition in theme.moon? We'll add this to master later then and do a point release with the work-around afterwards.

finnbar commented 8 years ago

Yes, it was exactly the fix you suggested, so I went into my howl folder, added that to css_template in lib/howl/ui/theme.moon, then ran make and sudo make install. So that's an easy fix to apply, although you might want to check it doesn't do anything silly in systems that it was already working in. But not tonight.

Goodnight. :)

finnbar commented 8 years ago

I've just noticed this leaves us with a secondary problem, which I'm trying to fix now - with a border of zero, no window controls appear at all. So you can't resize the window by dragging. Setting it to 2px makes the border only a little annoying, while still letting the controls work. I'll see if I can make it better, if so, I'll let you know.

finnbar commented 8 years ago

Well, I'm going to go to bed now. With the code below, all but the right window control are (mostly) accessible. I've added a tiny margin to the bottom, as that helps you grab the bottom control. I might have another look tomorrow, but I can't promise anything - but let me know if there's any way I can help!

.window-frame { box-shadow: none; margin: 0 0 2px 0; }

refi64 commented 8 years ago

@finnbar Well, goodnight then. :)

BUT...tomorrow, could you try .window-frame { box-shadow: none; margin: 15px; }?

finnbar commented 8 years ago

@kirbyfan64 Saw your message as I was packing up, so I thought I'd try it quickly. That creates a smaller version of the original problem. But it does make grabbing the window controls easier! Anyway, to bed for real this time. Goodnight. :)

finnbar commented 8 years ago

Just did some more experimenting - I can't seem to get it to be better than .window-frame { box-shadow: none; margin: 0 0 2px 0; }. This means that the right window resize control doesn't come up. Applying an overall margin of 1px creates a slight border while being able to resize stuff, so that might be a good compromise.

nilnor commented 8 years ago

I committed a hybrid path with 1px margin for left and right, and 2px for the bottom where it's not so apparent. Noticed another problem when trying out Elementary, where the scrollbars ends up being effectively hidden since it clashes with the built-in theme, but will look at that later.

finnbar commented 8 years ago

That looks good! I don't have the problem you have with the scrollbars though - they seem to be there for me (or at least in Monokai).

nilnor commented 8 years ago

Great! Re the scrollbars, they are there but for me with the Monokai theme they are effectively invisible since they're black on Freya, and looking at your first screenshot that seems to be the same there. So it's a color matching / theme thing that we need to fix (PR coming up later).