Giter Club home page Giter Club logo

granite's Introduction

Granite

Granite is a companion library for GTK and GLib. Among other things, it provides complex widgets and convenience functions designed for use in apps built for elementary OS.

Packaging status Translation status

Building, Testing, and Installation

You'll need the following dependencies:

  • meson >= 0.57.0
  • gobject-introspection
  • libgee-0.8-dev
  • libgirepository1.0-dev
  • libgtk-4-dev >= 4.4.0
  • sassc
  • valac

Run meson build to configure the build environment:

meson build --prefix=/usr

This command creates a build directory. For all following commands, change to the build directory before running them.

To build granite, use ninja:

ninja

To install, use ninja install

ninja install

To see a demo app of Granite's widgets, run granite-7-demo after installing it:

granite-7-demo

Documentation

Documentation for all of the classes and functions in Granite is available on Valadoc

The additional requirements for building the documentation are:

  • valadoc
  • gtk-doc

To generate gtk-doc and valadoc documentation for this project, pass the additional -Ddocumentation=true flag to meson, and run ninja as before.

granite's People

Contributors

cassidyjames avatar codygarver avatar danirabbit avatar davidgomes avatar davidmhewitt avatar davies-adam avatar donadigo avatar elementarybot avatar gangsterveggies avatar hugok79 avatar ihorhordiichuk avatar josprachi avatar junrrein avatar marcin-serwin avatar marcus-lundgren avatar nasserbinlaboun avatar nathanbnm avatar niclaslockner avatar queeup avatar ricotz avatar ryonakano avatar shnatsel avatar tintou avatar tom95 avatar victored avatar voldyman avatar voluntatefaber avatar weblate avatar xapantu avatar yarons avatar

Stargazers

 avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar

Watchers

 avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar

granite's Issues

New Tabs Design

When making a App with tabs, designers always focus on something: they make the selected-tab's color the same as the content inside that tab. Look at Chrome or Firefox (or even Midori), the selected-tab's color is the same of the URL color. Actually, they are somehow connected with that URL and the buttons on URL bar.

http://uxmovement.com/navigation/designing-tab-navigation-the-right-way/

This is more difficult to accomplish in pantheon-terminal, because the content is black (and transparent). Given that, the Elementary designers must have felt that making the selected tab's color the same of the window decoration would be a great idea. And I agree.

But we have a little problem, we lost the sense of connection. The tabs are not touching or "merging" with the decorations. Now we have three things on the top: The decoration, the selected tab and the non-selected tabs. This makes the top of the window very cluttered and hard to navigate.

Sorry about my english

Launchpad Details: #LP1138120 Paulo Roberto de Oliveira Castro - 2013-03-01 16:31:21 +0000

No result view can cause launcher window to grow

The "No Result" view of Slingshot can cause the launcher's window to grow in size. The problem is that it stays that way. If you search for a long term that doesn't exist the window will just continue to grow to fit the text of the search term. After closing the launcher and re-opening the size of the launcher window will still be large.

There are a few different solutions I thought of for this.

  1. Cut off the result text and use an ellipsis so that the window doesn't grow.
  2. Resize the window back to it's original size after it is closed (probably triggered by a signal and you would need to clear the title text for the alert view).
  3. Just don't display the result text in the window.

I think the 3rd solution is the best, personally. The search term is already in the search bar and there's no need to repeat it in the window. Just have the window display "No Results" seems like a cleaner solution.

You can view the problem in action here:
https://youtu.be/LXZKCrfZhGo

Launchpad Details: #LP1630852 Matt Spaulding - 2016-10-06 04:25:28 +0000

Seekbar contrast in dark theme

One of my smaller annoyances with elementary Videos is how hard it is to see how far along a video is. This is mostly caused by the lack of contrast in the dark themes seekbar.
For reference a screenshot of Videos in Loki:
screenshot from 2018-02-10 10 22 43

A screenshot of the latest master branch of Videos on github:
screenshot from 2018-02-10 10 25 04

The contrast in the light theme seekbar seems a lot better, for reference Videos in light theme:
screenshot from 2018-02-10 10 34 18

Comparison

The seekbar in Youtube:
screenshot from 2018-02-10 11 31 23

Videos in Arc-solid theme:
screenshot from 2018-02-10 11 34 35

Seekbar widget [$15]

There might be a better word for this, but I can't think of it.

We have a little playback statusbar in Audience and in Noise that includes a gtk.scale and two labels showing current time and time remaining. In the case of Audience it also includes a preview popover. Now there's also a third party app, Vocal, using an imitation of this.

I think we should consider making this a widget.

At the very least, we should adopt a class name for this widget because I'd like the gtk.scale in this widget not to have a visible handle.

Launchpad Details: #LP1317211 Daniel Fore - 2014-05-07 17:54:00 +0000

Add light / dark theme switch to demo

To test and demo the dark themed granite components it would be helpfull if we could switch the granite-demo between light and dark.
Maybe we could add a simple toggle button to the headerbar, like Quickdocs:
screenshot from 2018-02-10 10 45 40

Granite.Application prevents destructors being called

When subclassing Granite.Application, Granite itself keeps a static reference to your app under Granite.app. This reference never gets released within Granite which unfortunately leads to destructors in the subclass not being called. The reference is set here:
https://github.com/elementary/granite/blob/master/lib/Application.vala#L158

That property has been deprecated since Granite 0.1 so I'd be interested to see if there was anything still using it.

I have had to work around this in Torrential with the following:
https://github.com/davidmhewitt/torrential/blob/master/src/Application.vala#L118

When you know what the problem is, it's not too bad to solve, but it took a lot of debugging to get to the point of blaming Granite rather than my own app 😉

Provide a placeholder for listboxes

Just something I noticed while playing around:

I have an application with a listbox as one of the core widgets. But at the beginning this list will always be empty. I now created a stack with a new Granite.WelcomeScreen, but I have to take care of switching myself. And I doubt that the welcome screen has the right styling for this. At the point where the listbox is visible the user already had a welcome screen to open a file.

So what I am proposing is a Container based on Gtk.ListBox which allows me to add a placeholder headline and description.

Maybe a generic placeholder style can be made? I am thinking of something like the view of an empty folder in the files app.

Drawing bugs when hiding elements in ModeButton

If you hide first element in ModeButton the whole widget starts to draw weird. If you have other ModeButton's in headerbar they also get affected somehow by this widget.

modebuttonscreenshot

code example:

var test = new Granite.Widgets.ModeButton();
test.append_text("0");
test.append_text("1");
test.append_text("2");
test.append_text("3");
test.set_item_visible(0, false);

Also if you hide last item then last visible item does not have rounded end.

ModeButton activates on press instead of press + release

Buttons in GTK typically respond on "clicked" which is a press + release; for example, this lets you drag a window from a button without triggering the button. Granite ModeButtons, however, appear to activate on press only, meaning if you drag a window from a ModeButton, you also press the button.

This affects at least Music and Files with regards to dragging the window, but it's reproducible in Granite Demo's ModeButtons; compare the behavior of the "Clear Selected" button (pressing, then dragging off the button does not activate it) to the ModeButtons (pressing, then dragging off activates anyway).

Remove cmake/ParseArguments.cmake

Hi elementary group,

I see cmake/ParseArguments.cmake in the repo may be obsolete.

According to https://cmake.org/Wiki/CMakeMacroParseArguments , "If you are using CMake 2.8.3 or newer please use the CMakeParseArguments macro provided by the default CMake installation instead of the code below." Since your CMakeLists.txt specifies cmake_minimum_required (VERSION 2.8), there's no need to such file any more.

Please consider remove it (and probably more like this).

Source: https://bugs.debian.org/873094#45

Delay resizing tabs when closed

Firefox and Chromium provides "smart tabs". That is; when you close a tab the close button of the right most tab is getting in a position where the cursor is hovering over it. If you click then same thing happens again, if you wait more than 2 or 3 seconds or move away the cursor then the tabs sizes gets adjusted, if needed.

Thanks for reading.

Launchpad Details: #LP1214933 Karl-Oskar "klrr" Rikås - 2013-08-21 14:23:10 +0000

ModeButton can be untoggled [$10 awarded]

If you click on mode that is selected then no mode is shown as active anymore. Sometimes this is wanted, but sometimes you need one of modes to be always on.

Some examples where this issue can be observed:

  • view modes in Files
  • Primary button section in Mouse & Touchpad settings

The $10 bounty on this issue has been claimed at Bountysource.

[Granite instropection] In Granite.Application the properties for about dialog not set

i try to set on Granite.Application the properties for about dialog ( program_name, authors, developers etc) and not work when i call show_about

########################3
from gi.repository import Granite
from gi.repository import Gtk

class T(Granite.Application):
program_name ="test"

def do_activate(self):
    win = Gtk.Window(application=self)
    win.connect("destroy", lambda x: Gtk.main_quit())
    self.show_about(win)
    win.show_all()

t = T()
t.run("",1)

####################

output http://i.imgur.com/dfQZs.png

i think the problem is

on the method show_about when call in vala:

Granite.Widgets.show_about_dialog ((Gtk.Window) parent,
"program_name", program_name,

program_name it not take from self.program_name in python.

Launchpad Details: #LP1090662 zodman - 2012-12-15 08:03:37 +0000

Options no longer recognized

Passing local options to Granite Applications no longer works. Only Gtk options like -h are recognised. The local options are shown with -h but are no longer functional, resulting in an "option not recognised" error when launching from a terminal. Application functions that use these options, such as Files when launching Terminal no longer work.

This may be related to ab03e78

Essentially, unrecognised options are no longer ignored and running the app fails rather than passing the options to the instance to handle.

MessageDialog: add a property for overlay icon

There's several dialogs that overlay a small icon in the bottom right corner (like the Agent dialogs). It would be nice if we provided an easy way to do that in Granite.MessageDialog

Double click to rename tab

I would like to be able to rename terminal tabs. When using byobu/tmux in an ssh session tab name turns into something like

...hat.com - byobu (0)

 which is completely uninformative.

Launchpad Details: #LP1184312 Alex Lourie - 2013-05-26 10:40:45 +0000


Want to back this issue? Post a bounty on it! We accept bounties via Bountysource.

Granite Demo's SourceList should be wider by default

If we're gonna provide a demo app, we might as well do it right! Right now the source list is too skinny and ellipsizes the contents ootb. We should fix it. Bonus points if it lines up with the right side of the viewmode widget.

Launchpad Details: #LP1173015 Cassidy James Blaede - 2013-04-26 04:54:26 +0000

Better calendar widget

The new calendar widget on wingpanel looks great, wouldn't it be better if it was extracted to a granite widget to replace the current granite date picker.
image

Add support to flash tabs in DynamicNotebook

Some apps occasionally need to inform the user that something changed in a not focused tab. For example in a browser if a certain not focused tab has an email page and you get an email, the tab should flash so that the user knows something new happened. Other applications would be for example in the terminal when a tab has new output the user should be warned again.

Launchpad Details: #LP1214220 Pedro Paredes - 2013-08-20 03:14:31 +0000


Want to back this issue? Post a bounty on it! We accept bounties via Bountysource.

Overlaybar should not own reference to overlay

Because Overlaybar holds an owned reference to the overlay it is in, and vice-versa, a circular reference is created preventing automatic destruction of these widgets and hence possible memory leaks.

Add a duration property for Toasts

It looks like the Android implementation offers a property duration.

Gtk.Stack and Gtk.Revealer both offer a property uint transition_duration, so I think duration is a sane name.

The Android implementation also offers two constants:

LENGTH_LONG = 3500; // 3.5 seconds
LENGTH_SHORT = 2000; // 2 seconds

I'm not a fan of the names. It seems counter-intuitive to me to have duration be the property and then all the sudden the constant is LENGTH_FOO. Especially because I think "length" could also refer to physical dimensions so it's kind of an ambiguous name. So I would be in favor of maybe DURATION_LONG and DURATION_SHORT. In practice this would look like

var toast = new Granite.Widgets.Toast (_("This is a notification"));
toast.duration = Granite.Widgets.Toast.DURATION_SHORT;

Couple of open questions:

  • Should the default duration still be infinity or should non-actionable Toasts disappear by default at some duration?
  • Should the duration property be a uint like Gtk.Foo.transition_duration or should it be an enum like on Android? (ie no custom durations, only a choice between predefined durations)

Logging to Systemd journal by default?

This might not be the right place to start this discussion, please let me know if it's not.

I've seen a couple of bug reports where people where asked to restart the application with debugging enabled (-d):

This is problematic because issues aren't always easy to reproduce. I understand some services leave logs in systemd's journal. I can for example request redshifts logs using:

journalctl -u redshift

Why don't the parts that make up elementary OS log to this journal? Would this impact performance? It might take up more disk space, although that's limited by configuration. Looks like it only keeps 100 system and 100 runtime log files.

Now why I'm opening this here, I noticed that Granite has a logger service (which is even automatically initialized in Granite.Application). Wouldn't it make sense to have this logger log to systemd journal by default?

SourceList isn't well represented in the demo

In the demo Sourcelist has tons of categories that are all collapsed and no icons on items. This isn't what it looks like in practice. We should demo as one would normally see it in app: with 3-4 categories, expanded by default, and icons on the items

Launchpad Details: #LP1516120 Daniel Fore - 2015-11-13 18:37:49 +0000

Middle-click close tab should cancel if the button release is not over the tab widget

Similar to but distinct from #82. Middle-clicking to close a tab should only work when both the press and release even occur with the cursor over the tab.

On my machine (with a physical mouse, not a trackpad), it appears that middle-clicking a tab, dragging the cursor away from the tab, then releasing the middle-click still closes the tab. Instead, middle-click, drag, and release should not close the tab since the release is not occurring on the tab widget.


Want to back this issue? Post a bounty on it! We accept bounties via Bountysource.

Avatar: sizes are mismatched at 48px

at 48px, the empty avatar is smaller than the populated one. The populated one needs to be shrunk a few pixels and have margins adjusted to match.

Launchpad Details: #LP1535510 Daniel Fore - 2016-01-19 03:14:54 +0000

Options not passed on to first instance when second instance invoked.

If an instance of a Granite Application is already running and a second instance is started with options, a second window is opened by the first instance and the second instance closes (as expected) but the first instance does not receive the options from the second invocation.

It is not entirely clear whether this is due to changes in Granite or the underlying libraries.

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. 📊📈🎉

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google ❤️ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.