Opened 6 years ago

Closed 4 years ago

#8865 closed enhancement (fixed)

Slider bar should change brush and line width

Reported by: brian Owned by: Quozl
Priority: normal Milestone: 11.2.0-M3
Component: paint/drawing-activity (oficina) Version: 1.5/1.0 Software Build os860 aka 10.1.3
Keywords: Cc: FGrose, godiard
Blocked By: Blocking:
Deployments affected: Action Needed: no action
Verified: no

Description

The slider bar (circles on the top of the XO keyboard) should change the width of the paintbrush and line widths in Paint activity. This would make drawing-without-modifying-tools-by-mouse easier.

example of one way to do this -- in Area.py... function key_press:

if event.keyval == 65474: # 65474 to 65477 are slider bar keys

self.line_size = 2

self.configure_line(self.line_size)

Change History (18)

comment:1 Changed 6 years ago by mstone-xmlrpc

  • Keywords cjbfor9.1.0 added
  • Milestone changed from 8.2.1 to 9.1.0

Pushing out to 9.1.0, per edmcnierney's request.

comment:2 Changed 4 years ago by Quozl

  • Action Needed changed from add to build to review
  • Owner changed from alexandre to Quozl
  • Status changed from new to assigned

A patch proposed by Gonzalo Odiard which adds relative size change using the slider keys.

comment:3 Changed 4 years ago by FGrose

  • Milestone changed from 9.1.0-cancelled to 10.1.3

Testing with Paint-28 on XO-1 with os852, the f5 & f6 buttons have been assigned to Journal Search and toggle Frame, respectively.

In order to maintain the keyboard utility of width changes, the f7 should be reassigned to -5 units, or the Journal and Frame actions overridden.

If the 2-button adjustment control is adopted, perhaps an <alt f7> keypress invoke a -1 unit action and <alt f8> a +1 unit action.

Additionally, the tool's size_spinbutton value is not updated when the slider bar buttons are pressed. Thus, the display of tool size in its palette is misleading (although the new, tool area outline may mitigate the confusion).

comment:4 Changed 4 years ago by pgf

  • Cc FGrose added

at the same time that we had sugar grab F5 and F6, we set things up so that Fn-F<any> would map to F<any>. so holding the Fn key and the slider should (might?) get you what you need. i say "might?" because the slider has some "half" keys, in between the "normal" F-keys, and they might not have been picked up in the new mapping. please test that.

comment:5 Changed 4 years ago by FGrose

Pressing <fn f5-8> in Paint-28 on os852, XO-1 results in the same actions as <f5-8> keypresses, but pressing <ctrl f5-8> has the intended actions of -5, -1, +1, +5.

I didn't notice any 'half-key' actions. Were they designed to result from combined key presses?

Some code seems to be at http://git.sugarlabs.org/projects/paint/repos/mainline/blobs/master/OficinaActivity.py#line136

def key_press(self, widget, event):
    sliders = {65474: -5, 65475: -1, 65476: 1, 65477: 5}
    if event.keyval in sliders:
        self.area.change_line_size(sliders[event.keyval])

comment:6 Changed 4 years ago by pgf

sorry. i'm an idiot sometimes. the Fn key won't help here. sugar will respond the same to the Fn version as it does to the non-Fn version, because they produce the same value.

comment:7 Changed 4 years ago by erikos

  • Cc godiard added
  • Owner changed from Quozl to erikos
  • Status changed from assigned to new

comment:8 Changed 4 years ago by erikos

  • Owner changed from erikos to Quozl

Sorry, the assignment was unintentional.

comment:9 Changed 4 years ago by martin.langhoff

Confusing. What is the status? Code seems to be in place but is not getting triggered?

comment:10 follow-up: Changed 4 years ago by godiard

After the enhacement was implemented, Sugar changed the keybord use, and now F5 and F6 are used for the Frame and the Journal http://wiki.sugarlabs.org/go/0.90/Notes.

We must change the use in Paint.

comment:11 in reply to: ↑ 10 ; follow-up: Changed 4 years ago by erikos

Replying to godiard:

After the enhacement was implemented, Sugar changed the keybord use, and now F5 and F6 are used for the Frame and the Journal http://wiki.sugarlabs.org/go/0.90/Notes.

And it went into 0.84 because of the HS keyboard: http://git.sugarlabs.org/projects/sugar/repos/mainline/commits/9e0172214cf53920372178afb47123147c251297

The F5-F8 keys have been always unused on the XO-keyboard, afaik. Apart from that I am not 100% happy they do as well match the journal/frame on the XO keyboard - a bit confusing, but maybe not triggered as often to worry about.

comment:12 in reply to: ↑ 11 Changed 4 years ago by erikos

Replying to erikos:

Replying to godiard:

After the enhacement was implemented, Sugar changed the keybord use, and now F5 and F6 are used for the Frame and the Journal http://wiki.sugarlabs.org/go/0.90/Notes.

And it went into 0.84 because of the HS keyboard: http://git.sugarlabs.org/projects/sugar/repos/mainline/commits/9e0172214cf53920372178afb47123147c251297

The F5-F8 keys have been always unused on the XO-keyboard, afaik. Apart from that I am not 100% happy they do as well match the journal/frame on the XO keyboard - a bit confusing, but maybe not triggered as often to worry about.

Basically what is discussed in #10341.

comment:13 Changed 4 years ago by godiard

  • Action Needed changed from review to package

I have modified Paint to use the keys "+" and "-" to change the size of the tool.

comment:14 Changed 4 years ago by godiard

  • Action Needed changed from package to add to build

comment:15 Changed 4 years ago by dsd

Gonzalo, please state what version you think is fixed. That way I can verify the build.

comment:16 Changed 4 years ago by godiard

Version 33

comment:17 Changed 4 years ago by dsd

  • Action Needed changed from add to build to test in build

Test in 11.2.0 build 20

comment:18 Changed 4 years ago by Quozl

  • Action Needed changed from test in build to no action
  • Keywords cjbfor9.1.0 removed
  • Resolution set to fixed
  • Status changed from new to closed
  • Version changed from not specified to 1.5/1.0 Software Build os860 aka 10.1.3

Tested in os20, + and - change the size of the tool. Closing.

Note: See TracTickets for help on using tickets.