[RFC] [PATCH 0/4] Make the C network-manager-gnome applet as sexy as the gnome-shell one



Hello, this is an intent to get the C GNOME applet to look nice:
i.e. have switches for each device.  the patch is incomplete, but is
more a proof of concept than anything else.

you can see the result here:
http://core.evilgiggle.com/~xaiki/hacks/network-manager/new-nm-applet-sc.png
with a Dark GTK theme on the main screen, and the NO-theme theme in
the Xephyr.

in a nutshell:
+ Toggle button for each NMDevice (tested that it works for wireless
  only)
+ a spinner when the device state is not stable (connecting,
  disconnecting, searching,…)

[PATCH 1/4] reorder a bit the 'draw' signal hack

instead of drawing the label only, we draw in the menuitem cr, and
return FALSE to get the other widgets to draw, then we hookup 'draw'
on the label to inibit drawing there.

[PATCH 2/4] whitespace fixup

it was getting in my eyes all the time.

[PATCH 3/4] move creation of applet_menu_item_create_device_item_helper to it's own helper

this makes room for more complex widgets,
at this stage everything looks the same.

[PATCH 4/4] Add switches to the Applet menu
+ pass down the menu,
+ add to the menu in applet.c (factorizing 3 lines of identical code in
  all the devices)
+ create a box with a spinner and a switch
+ hook up various signals so that the spinner and switch always
  reflect the right state (yes, it's live)
+ implement toggle functions for the devices I could.

as said it's quite incomplete, on the graphical side:
+ there is some work to do to better the cairo hacks that make the font
  look nice (and actually fall apart as soon as I set the menu item to
  be sensitive)

+ there is a need for a size_request hack, with the current form of
  the patch, there is a bit of floating space after the Network Name,
  due to the fact that we actually allocate the correct size for the
  label, but draw it some 25-30 pixels to the left.

I was looking for a way to disable a specific device, I really
expected NMDevice->disable(), or NMDevice->set_enabled(), but couldn't
find anything like that,

+ wired and bt need an implementation for the _toggle method (I couldn't find how to do that).
+ gsm and cdma need checking, and maybe a different _toggle method.

I haven't checked that this works with gtk < 3.2, I believe it doesn't
the switch was introduced in 3.0 if I'm not mistaken.

anyway, thanks for reading, tell me what you think



[Date Prev][Date Next]   [Thread Prev][Thread Next]   [Thread Index] [Date Index] [Author Index]