Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

the stars displayed next to the fonts are unresponsive to clicks #16

Open
YashAgarwal opened this issue May 16, 2016 · 10 comments
Open

Comments

@YashAgarwal
Copy link
Contributor

Inside the edit-font activity stars displayed next to the fonts are unresponsive and the selections can not be changed. The following GIF demonstrates the issue.
The GIF showing the issue

@YashAgarwal YashAgarwal self-assigned this May 16, 2016
@davelab6
Copy link
Contributor

Please also assign a milestone to each issue :)

@davelab6 davelab6 added this to the Milestone 1: Font Manager milestone May 16, 2016
@davelab6
Copy link
Contributor

BTW How do you make these gif screencasts? :)

@YashAgarwal
Copy link
Contributor Author

I used this
http://www.unixmen.com/make-animated-gif-screencasts-easily-byzanz/

short version :
sudo add-apt-repository ppa:fossfreedom/byzanz
sudo apt-get update
sudo apt-get install byzanz
byzanz-record --duration=20 --x=0 --y=0 --width=1024 --height=800 output.gif

On Mon, May 16, 2016 at 6:48 PM Dave Crossland notifications@github.com
wrote:

BTW How do you make these gif screencasts? :)


You are receiving this because you authored the thread.
Reply to this email directly or view it on GitHub
#16 (comment)

@YashAgarwal
Copy link
Contributor Author

The stars are displayed for the fonts which are hard coded in the array DEFAULT_FONTS = ['Sans', 'Serif', 'Monospace'], So to solve this properly I need to make a file in sugar stating the list of favourite fonts.

  1. Where should this file be stored? (I don't only this activity will be using the list, it should be a system-wide setting)
  2. What will be the meaning of "favourite fonts" for the sugar OS? [an immediate answer is not required]

@davelab6
Copy link
Contributor

Where should this file be stored? (I don't only this activity will be using the list, it should be a system-wide setting)

Please ask on sugar-devel :)

What will be the meaning of "favourite fonts" for the sugar OS? [an immediate answer is not required]

I think there is no meaning outside the activity; its just a way of marking fonts in a shortlist, similar to the 'collection' in www.google.com/fonts

Its possible that we could have more than one 'favourite fonts' list, expanding the functionality to collections management; this is the functionality provided by the OS X "Font Book" font manager. Here's a screencast I just made showing the basic features of that: https://youtu.be/nYdPxfcZN6k

Given there is only one 'favourite fonts' list, it would be good to have a visibility toggle to hide all the families not in the short list.

It would also be good to have a way to see the styles within a family.

@davelab6
Copy link
Contributor

@YashAgarwal when do you want to schedule this?

@YashAgarwal
Copy link
Contributor Author

This cell is not receiving any click events

cell_favorite = CellRendererFavorite()
cell_favorite.connect('clicked', lambda _: logging.warning("Hello"))

Is any other property I need to set to make it receive click events?
It is receiving hover events though as you can see in the gif

I looked at the activitieslist.py for reference but still couldn't find any differences

@YashAgarwal
Copy link
Contributor Author

SOLVED
This is my current solution I would call it an alternative way to the one sugar uses currently to mark activities as favorite in the journal activity list which I wasn't able to implement

cell_favorite = CellRendererClickablePixbuf()
loader = GdkPixbuf.PixbufLoader()
loader.write(svg_active.encode())
loader.close()  
cell_favorite.props.pixbuf = loader.get_pixbuf()
cell_favorite.props.mode = Gtk.CellRendererMode.ACTIVATABLE        
cell_favorite.connect('clicked', self.__favorite_clicked_cb)

where this is the CellRendererClickablePixbuf class definition

class CellRendererClickablePixbuf(Gtk.CellRendererPixbuf):

    __gsignals__ = {
                    'clicked': (GObject.SignalFlags.RUN_FIRST, None,
                                ([str]))
                    }

    def __init__(self):
        super(CellRendererClickablePixbuf, self).__init__()

        self.props.icon_name = STAR_ICON_NAME
        self.props.mode = Gtk.CellRendererMode.ACTIVATABLE

    def do_activate(self, event, widget, path, background_area, cell_area,
                    flags):
        self.emit('clicked', path)

This solves this bug but I'll keep this open in case someone knows how this is done in the journal

@davelab6
Copy link
Contributor

davelab6 commented Jul 1, 2016

@YashAgarwal I suggest posting in the sugar-devel list with a subject similar to "Help needed with Sugar Journal style star'ing" :)

@davelab6 davelab6 assigned davelab6 and eliheuer and unassigned YashAgarwal Jul 6, 2016
@davelab6 davelab6 added Confirm fixed and removed bug labels Jul 6, 2016
@davelab6
Copy link
Contributor

davelab6 commented Jul 6, 2016

I believe this now just needs to be confirmed in the next .xo build

@davelab6 davelab6 assigned YashAgarwal and unassigned eliheuer and davelab6 Jul 30, 2016
@davelab6 davelab6 assigned davelab6 and unassigned YashAgarwal Aug 8, 2016
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

No branches or pull requests

3 participants