Merge lp:~elementary-apps/pantheon-terminal/csd-titlebar into lp:~elementary-apps/pantheon-terminal/trunk

Proposed by Danielle Foré
Status: Merged
Approved by: Victor Martinez
Approved revision: 559
Merged at revision: 559
Proposed branch: lp:~elementary-apps/pantheon-terminal/csd-titlebar
Merge into: lp:~elementary-apps/pantheon-terminal/trunk
Diff against target: 24 lines (+8/-1)
1 file modified
src/PantheonTerminalWindow.vala (+8/-1)
To merge this branch: bzr merge lp:~elementary-apps/pantheon-terminal/csd-titlebar
Reviewer Review Type Date Requested Status
Victor Martinez (community) Approve
Danielle Foré Abstain
Review via email: mp+215373@code.launchpad.net

Commit message

use CSD titlebar

Description of the change

* Uses CSD titlebar instead of server-side.
* Removes the "header-bar" class, allowing the decorations to fall back to the slimmer "titlebar" class

To post a comment you must log in.
Revision history for this message
Danielle Foré (danrabbit) wrote :

So there are two problems in this branch:

1. I don't know how to connect the signal such that the label listens for changes to the window title. I have Matthias' C code in the comment. Not sure how to translate it.

2. I don't know how to set the style class for the label. I swear to god it should be straightforward, but I can't figure it out.

review: Needs Fixing
Revision history for this message
Tom Beckmann (tombeckmann) wrote :

This would fix those problems: http://pastebin.com/ZSu20LpU

Revision history for this message
Danielle Foré (danrabbit) wrote :

Actually this branch isn't going to work because there are no buttons xD

review: Disapprove
Revision history for this message
Danielle Foré (danrabbit) :
review: Abstain
559. By Danielle Foré

don't need to set titlebar class

Revision history for this message
Danielle Foré (danrabbit) wrote :

Okay, I'm stupid. So what I did is I used GtkHeaderBar, but then I removed the "header-bar" class (which is what adds all the crazy padding). It still retains the "titlebar" class and looks pretty sexy.

Revision history for this message
Jeremy Wootten (jeremywootten) wrote :

I am not sure about removing the header-bar class. If you want control over the padding and other features of the title you could use a custom title. For example:

            var header = new Gtk.HeaderBar ();
            header.set_show_close_button (true);
            var custom_title = new Gtk.Label (_("Terminal"));
            custom_title.set_padding (20,10);
            custom_title.set_ellipsize (Pango.EllipsizeMode.START);
            header.set_custom_title (custom_title);
            notify["title"].connect (() => {
                custom_title.label = title;
            });
            this.set_titlebar (header);

Revision history for this message
Danielle Foré (danrabbit) wrote :

I don't want the app to control the padding though, I want it controlled in the theme. Right now GtkHeaderBar already carries the two classes "titlebar" and "headerbar". They have their subtle differences in the theme that extend beyond just the padding (for example, the titlebar doesn't need such a dramatic gradient since it is so much shorter). All this does is remove the "headerbar" class which overrides/extends the theming set in .titlebar

Revision history for this message
Jeremy Wootten (jeremywootten) wrote :

Fair enough, but I don't like the way the default styling causes the title
to collide with the left hand edge when the title is longer than the space
allows. I prefer at least a little padding. Ellipsizing the start also
matches the ellipsizing on the tab labels. You can still use a custom
title while still removing the header-bar class.

On 12 April 2014 15:35, Daniel Fore <email address hidden> wrote:

> I don't want the app to control the padding though, I want it controlled
> in the theme. Right now GtkHeaderBar already carries the two classes
> "titlebar" and "headerbar". They have their subtle differences in the theme
> that extend beyond just the padding (for example, the titlebar doesn't need
> such a dramatic gradient since it is so much shorter). All this does is
> remove the "headerbar" class which overrides/extends the theming set in
> .titlebar
> --
>
> https://code.launchpad.net/~elementary-apps/pantheon-terminal/csd-titlebar/+merge/215373
> Your team elementary Apps team is requested to review the proposed merge
> of lp:~elementary-apps/pantheon-terminal/csd-titlebar into
> lp:pantheon-terminal.
>

Revision history for this message
Danielle Foré (danrabbit) wrote :

I'm not having any collision issues here: http://imagebin.org/305374

But yeah, changing the ellipsis to start would be a nice touch. But as we currently don't do that in trunk, I don't think it has any bearing on this MR.

Revision history for this message
Victor Martinez (victored) :
review: Approve
Revision history for this message
Jeremy Wootten (jeremywootten) wrote :

Hmmm ... could explain the difference of opinion ... Here's how it looks
on my system:

http://imagebin.org/305520

This is your branch compiled on a recent 32-bit iso of Trusty with
necessary libraries obtained from the elementary-os daily and testing ppa's.

Launched using a terminal other than pantheon-terminal obviously!

On 13 April 2014 21:36, Daniel Fore <email address hidden> wrote:

> I'm not having any collision issues here: http://imagebin.org/305374
>
> But yeah, changing the ellipsis to start would be a nice touch. But as we
> currently don't do that in trunk, I don't think it has any bearing on this
> MR.
> --
>
> https://code.launchpad.net/~elementary-apps/pantheon-terminal/csd-titlebar/+merge/215373
> Your team elementary Apps team is requested to review the proposed merge
> of lp:~elementary-apps/pantheon-terminal/csd-titlebar into
> lp:pantheon-terminal.
>

Preview Diff

[H/L] Next/Prev Comment, [J/K] Next/Prev File, [N/P] Next/Prev Hunk
1=== modified file 'src/PantheonTerminalWindow.vala'
2--- src/PantheonTerminalWindow.vala 2014-04-01 15:03:37 +0000
3+++ src/PantheonTerminalWindow.vala 2014-04-11 15:58:29 +0000
4@@ -149,6 +149,13 @@
5 }
6
7 private void setup_ui () {
8+ /* Use CSD */
9+ var header = new Gtk.HeaderBar ();
10+ header.set_show_close_button (true);
11+ header.get_style_context ().remove_class ("header-bar");
12+
13+ this.set_titlebar (header);
14+
15 /* Set up the Notebook */
16 notebook = new Granite.Widgets.DynamicNotebook ();
17 notebook.show_icons = false;
18@@ -666,4 +673,4 @@
19 action_fullscreen }
20 };
21 }
22-}
23+}
24\ No newline at end of file

Subscribers

People subscribed via source and target branches