Skip to content

Commit dbc74b0

Browse files
added hints to buttons of edit sidebar, faded the DropTarget UI (lower opacity), removed old keyboard focus related code from StoryItem
1 parent 6da3a5c commit dbc74b0

File tree

4 files changed

+17
-34
lines changed

4 files changed

+17
-34
lines changed

App/Views/READCOM.Views.Main.fmx

+5-2
Original file line numberDiff line numberDiff line change
@@ -21,8 +21,6 @@ object MainForm: TMainForm
2121
Size.Width = 876.000000000000000000
2222
Size.Height = 616.000000000000000000
2323
Size.PlatformDefault = False
24-
ParentShowHint = False
25-
ShowHint = True
2624
inherited layoutContent: TLayout
2725
Size.Width = 876.000000000000000000
2826
Size.Height = 616.000000000000000000
@@ -46,6 +44,11 @@ object MainForm: TMainForm
4644
end
4745
inherited layoutButtonsMain: TFlowLayout
4846
Size.Height = 576.000000000000000000
47+
inherited btnLoad: TSpeedButton
48+
Hint =
49+
'Load Story'#13#13'Clears current contents and loads a Story'#39's contents' +
50+
' from a .readcom file'
51+
end
4952
end
5053
inherited layoutButtonsEdit: TFlowLayout
5154
Position.X = 826.000000000000000000

App/Views/READCOM.Views.Menu.HUD.fmx

+8
Original file line numberDiff line numberDiff line change
@@ -251,6 +251,7 @@ object StoryHUD: TStoryHUD
251251
Action = actionAdd
252252
Anchors = [akTop, akRight]
253253
Enabled = True
254+
Hint = 'Add Text'#13#13'Adds a TextStoryItem child into the edited StoryItem'
254255
Images = Globals.SVGIconImageList
255256
ImageIndex = 10
256257
Margins.Left = 3.000000000000000000
@@ -268,6 +269,7 @@ object StoryHUD: TStoryHUD
268269
Action = actionDelete
269270
Anchors = [akTop, akRight]
270271
Enabled = True
272+
Hint = 'Delete'#13#13'Removes the edited StoryItem'
271273
Images = Globals.SVGIconImageList
272274
ImageIndex = 8
273275
Margins.Left = 3.000000000000000000
@@ -285,6 +287,7 @@ object StoryHUD: TStoryHUD
285287
Action = actionCopy
286288
Anchors = [akTop, akRight]
287289
Enabled = True
290+
Hint = 'Copy'#13#13'Copies the edited StoryItem to the system clipboard'
288291
Images = Globals.SVGIconImageList
289292
ImageIndex = 17
290293
Margins.Left = 3.000000000000000000
@@ -302,6 +305,9 @@ object StoryHUD: TStoryHUD
302305
Action = actionPaste
303306
Anchors = [akTop, akRight]
304307
Enabled = True
308+
Hint =
309+
'Paste'#13#13'Pastes a StoryItem from the system clipboard into the edi' +
310+
'ted StoryItem as a new child'
305311
Images = Globals.SVGIconImageList
306312
ImageIndex = 18
307313
Margins.Left = 3.000000000000000000
@@ -317,6 +323,7 @@ object StoryHUD: TStoryHUD
317323
end
318324
object btnFlipHorizontally: TSpeedButton
319325
Anchors = [akTop, akRight]
326+
Hint = 'Flip Horizontally'#13#13'Mirrors the edited StoryItem horizontally'
320327
Images = Globals.SVGIconImageList
321328
ImageIndex = 19
322329
Margins.Left = 3.000000000000000000
@@ -332,6 +339,7 @@ object StoryHUD: TStoryHUD
332339
end
333340
object btnFlipVertically: TSpeedButton
334341
Anchors = [akTop, akRight]
342+
Hint = 'Flip Vertically'#13#13'Mirrors the edited StoryItem vertically'
335343
Images = Globals.SVGIconImageList
336344
ImageIndex = 20
337345
Margins.Left = 3.000000000000000000

App/Views/READCOM.Views.StoryItem.pas

+1-32
Original file line numberDiff line numberDiff line change
@@ -186,11 +186,8 @@ TStoryItem = class(TCustomManipulator, IStoryItem, IClipboardEnabled, IStoreab
186186

187187
protected
188188
procedure ActiveChanged;
189-
190-
//procedure CanFocus(var ACanFocus: Boolean); override;
191-
procedure KeyDown(var Key: Word; var KeyChar: WideChar; Shift: TShiftState); override;
192-
procedure MouseClick(Button: TMouseButton; Shift: TShiftState; X, Y: Single); override; //preferring overriden methods instead of event handlers that get stored with saved state
193189
procedure DropTargetDropped(const Filepaths: array of string); override;
190+
procedure MouseClick(Button: TMouseButton; Shift: TShiftState; X, Y: Single); override; //preferring overriden methods instead of event handlers that get stored with saved state
194191
procedure Tap(const Point: TPointF); override;
195192

196193
//--- Properties ---
@@ -301,8 +298,6 @@ procedure TStoryItem.Init;
301298
SendToBack; //TODO: ??? or done at ancestor anyway? (note order of Inits below will play part in resulting order) //always send to back after setting Visible
302299

303300
HitTest := False; //TODO: done at ancestor anyway?
304-
305-
OnDropped := DropTargetDropped;
306301
end;
307302
end;
308303

@@ -861,32 +856,6 @@ function TStoryItem.GetOptions: IStoryItemOptions;
861856

862857
{$REGION '--- EVENTS ---'}
863858

864-
{$region 'Keyboard'}
865-
866-
//TODO: fix to work with items that are to be focused only (depending on mode)
867-
procedure TStoryItem.KeyDown(var Key: Word; var KeyChar: WideChar; Shift: TShiftState);
868-
begin
869-
inherited;
870-
871-
var CurControl := TControl(Screen.FocusControl);
872-
case Key of
873-
vkReturn:
874-
SelectNext(CurControl);
875-
vkTab:
876-
SelectNext(CurControl, not (ssShift in Shift));
877-
end;
878-
end;
879-
880-
{
881-
procedure TStoryItem.CanFocus(var ACanFocus: Boolean);
882-
begin
883-
inherited;
884-
ShowMessage('Focused');
885-
end;
886-
}
887-
888-
{$endregion}
889-
890859
{$region 'Mouse'}
891860

892861
procedure TStoryItem.MouseClick(Button: TMouseButton; Shift: TShiftState; X, Y: Single);

Zoomicon.Manipulation/Zoomicon.Manipulation.FMX.CustomManipulator.pas

+3
Original file line numberDiff line numberDiff line change
@@ -223,8 +223,11 @@ procedure TCustomManipulator.Loaded;
223223
SetSubComponent(true); //don't show in Designer for descendents
224224
HitTest := False; //TODO: check if needed for drag-drop
225225
Visible := EditMode;
226+
Opacity := 0.4;
226227
SendToBack; //always do after setting Visible
227228
DropTarget.Align := TAlignLayout.Client;
229+
230+
Enabled := true;
228231
OnDragOver := DropTargetDragOver;
229232
OnDropped := DropTargetDropped;
230233
end;

0 commit comments

Comments
 (0)