Announcement

Collapse
No announcement yet.
X
  • Filter
  • Time
Clear All
new posts

    FormItem svg icons scaling

    SmartClient Version: v13.1p_2025-08-25/AllModules Development Only (built 2025-08-25)

    Chrome, FF on MacOS Sequoia

    Hi, in the latest 13.1 build there’s an issue with icon scaling in FormItems. It becomes very noticeable when using fontIncrease=4&sizeIncrease=15, e.g. https://www-demos.smartclient.com/sm...rease=15&dhc=1

    Click image for larger version

Name:	2025-08-25 21.51.21.jpg
Views:	30
Size:	8.0 KB
ID:	276292
    test case:

    Code:
    isc.DynamicForm.create({
        width: 400,
        margin: 10,
        titleWidth: 100,
        colWidths: [110, "*"],
        autoFocus: true,
        fields: [
            { name: "datePicker",type:"date", title: "Date Picker", icons: [ {src:"Cancel"} ] }
        ]
    });
    when running it, I see this in the developer console:

    Code:
    21:52:10.864:MUP5[E0]:WARN:PaneContainer:featureExplorer_exampleViewer_paneContainer:Invalid width or height in Canvas.enforceScrollSize() on component: featureExplorer_exampleViewer_paneContainer with sizes: -8544,-9407
        Canvas.enforceScrollSize(_1=>-8544, _2=>-9407) on [PaneContainer ID:featureExplorer_exampleViewer_paneContainer] @ ISC_Core.js:3938:250
        Layout._enforceScrollSize() on [PaneContainer ID:featureExplorer_exampleViewer_paneContainer] @ ISC_Foundation.js:363:6
        Layout.stackMembers(_1=>Array[2], _2=>Array[2], _3=>undef) on [PaneContainer ID:featureExplorer_exampleViewer_paneContainer] @ ISC_Foundation.js:353:71
        Layout.layoutChildren(_1=>"member changed visibility: [ExampleSourc..."[97], _2=>undef, _3=>undef) on [PaneContainer ID:featureExplorer_exampleViewer_paneContainer] @ ISC_Foundation.js:382:6
        Layout.reflowNow(_1=>"member changed visibility: [ExampleSourc..."[97], _2=>19) on [PaneContainer ID:featureExplorer_exampleViewer_paneContainer] @ ISC_Foundation.js:412:601
        [c]Layout.clearReflowQueue() on [Class Layout] @ ISC_Foundation.js:264:447
        null.<anonymous>() @ ISC_Foundation.js:264:82
        [c]EventHandler.runTeas() on [Class EventHandler] @ ISC_Core.js:3039:106
        EventHandler._clearThread() on [Class EventHandler] @ ISC_Core.js:3036:136
        FormItem.focusInItem() on [SelectItem ID:isc_SelectItem_2 name:monthSelector] @ ISC_Forms.js:1675:153
        DateItem.focusInItem() on [DateItem ID:isc_DateItem_0 name:datePicker] @ ISC_Forms.js:2905:475
        DynamicForm.focusInItem(_1=>[DateItem ID:isc_DateItem_0 name:datePicker], _2=>null) on [DynamicForm ID:isc_DynamicForm_0] @ ISC_Forms.js:780:24
        DynamicForm.setFocus(_1=>true, _2=>undef) on [DynamicForm ID:isc_DynamicForm_0] @ ISC_Forms.js:777:95
        Canvas.focus(_1=>undef) on [DynamicForm ID:isc_DynamicForm_0] @ ISC_Core.js:4530:238
        DynamicForm.parentVisibilityChanged(_1=>"inherit") on [DynamicForm ID:isc_DynamicForm_0] @ ISC_Forms.js:790:346
        Arra.callMethod(_1=>"parentVisibilityChanged", _2=>"inherit", _3=>[ExampleViewPane ID:featureExplorer_exampleViewer_exampleViewPane], _4=>true, _5=>false, _6=>undef) @ ISC_Core.js:638:183
        Canvas.parentVisibilityChanged(_1=>"inherit", _2=>[ExampleViewPane ID:featureExplorer_exampleViewer_exampleViewPane], _3=>true, _4=>false) on [Canvas ID:featureExplorer_exampleViewer_exampleViewPane_viewContainer] @ ISC_Core.js:4492:44
        Arra.callMethod(<no args: recursion>) @ ISC_Core.js:638:183
        Canvas.setVisibility(_1=>"inherit") on [ExampleViewPane ID:featureExplorer_exampleViewer_exampleViewPane] @ ISC_Core.js:4486:32
        Canvas.show() on [ExampleViewPane ID:featureExplorer_exampleViewer_exampleViewPane] @ ISC_Core.js:4510:6
        TabSet._showTab(_1=>Obj{title:View}) on [ExampleViewer ID:featureExplorer_exampleViewer] @ ISC_Containers.js:451:263
        TabSet._tabSelected(_1=>[SimpleTabButton ID:isc_SimpleTabButton_0]) on [ExampleViewer ID:featureExplorer_exampleViewer] @ ISC_Containers.js:462:6
        _3.buttonSelected(_19=>[SimpleTabButton ID:isc_SimpleTabButton_0]) on [TabBar ID:featureExplorer_exampleViewer_tabBar] @ ISC_Containers.js:341:596
        _3.setSelected() on [SimpleTabButton ID:isc_SimpleTabButton_0] @ ISC_Foundation.js:702:42
        StatefulCanvas.select() on [SimpleTabButton ID:isc_SimpleTabButton_0] @ ISC_Foundation.js:195:150
        Toolbar.selectButton(_1=>0) on [TabBar ID:featureExplorer_exampleViewer_tabBar] @ ISC_Foundation.js:738:278
        TabBar.selectTab(_1=>0) on [TabBar ID:featureExplorer_exampleViewer_tabBar] @ ISC_Containers.js:62:1476
        TabSet.selectTab(_1=>0) on [ExampleViewer ID:featureExplorer_exampleViewer] @ ISC_Containers.js:465:42
        ExampleViewer.showExample(_1=>undef) on [ExampleViewer ID:featureExplorer_exampleViewer] @ ISC_ExampleViewer.js:117:86
        ExampleSourcePane.tryEditedCode() on [ExampleSourcePane ID:featureExplorer_exampleViewer_exampleSourcePane] @ ISC_ExampleViewer.js:139:1905
        SourceEditor.tryClicked(_1=>undef) on [SourceEditor ID:featureExplorer_exampleViewer_exampleSourcePane_sourceEditor] @ ISC_ExampleViewer.js:144:491
        _3.eval(event=>Obj, eventInfo=>undef) on [IButton ID:featureExplorer_exampleViewer_exampleSourcePane_sourceEditor_sourceEditorToolbar_tryItButton] @ [no file]:3:35
        StatefulCanvas.handleActivate(_1=>Obj, _2=>undef) on [IButton ID:featureExplorer_exampleViewer_exampleSourcePane_sourceEditor_sourceEditorToolbar_tryItButton] @ ISC_Foundation.js:247:108
        StatefulCanvas.handleClick(_1=>Obj, _2=>undef) on [IButton ID:featureExplorer_exampleViewer_exampleSourcePane_sourceEditor_sourceEditorToolbar_tryItButton] @ ISC_Foundation.js:248:13
        [c]EventHandler.bubbleEvent(_1=>[IButton ID:featureExplorer_exampleViewer_exampleSourcePane_sourceEditor_sourceEditorToolbar_tryItButton], _2=>"click", _3=>undef, _4=>undef, _5=>undef) on [Class EventHandler] @ ISC_Core.js:2941:89
        [c]EventHandler.handleClick(_1=>[IButton ID:featureExplorer_exampleViewer_exampleSourcePane_sourceEditor_sourceEditorToolbar_tryItButton], _2=>undef) on [Class EventHandler] @ ISC_Core.js:2751:50
        EventHandler._handleMouseUp(_1=>[object MouseEvent], _2=>undef) on [Class EventHandler] @ ISC_Core.js:2733:11
        [c]EventHandler.handleMouseUp(_1=>[object MouseEvent], _2=>undef) on [Class EventHandler] @ ISC_Core.js:2724:57
        [c]EventHandler.dispatch(_1=>[c]EventHandler.handleMouseUp(), _2=>[object MouseEvent]) on [Class EventHandler] @ ISC_Core.js:3040:122
        HTMLDocument.eval(event=>[object MouseEvent]) @ [no file]:3:123

    #2
    Could you clarify - the issue seems to be that the close button ("cancel" icon) isn't large enough - you were expecting that to scale up larger?

    Comment


      #3
      Exactly, the cancel icon seems to be fixed at 16px in size, from Dense density up to Spacious and beyond.

      Comment


        #4
        hi Claudio - we've fixed scaling for FormItemIcons without a specified size (they fall back to FormItem.iconWidth/iconHeight).

        You can try out the fix as of today's builds, dated August 26.

        Comment


          #5
          Thank you very much, I can see it’s now working correctly (I still see the WARN though).

          I still have a doubt about the "date_range" icon of the DateChooser: with a density such as Spacious it appears noticeably larger, while with Dense it looks smaller than the additional icons. It seems to scale with a different factor. Is this intentional?

          Comment


            #6
            hi Claudio,

            The WARN is just a result of being run in our Showcase, where we have custom drawing and focusing behaviors. You won't see the log outside of the Showcase. The issue doesn't happen in 15.0, so we'll keep a note to have a look at fixing it in 13.1 when we have time. For the moment, if you want to avoid the WARN inside the Showcase, just get rid of your autoFocus setting, which you'll notice isn't working anyway!

            On the sizing of the DateChooser icon (all the items that use it), and actually the ColorItem icon as well - yes, it's intentional. These all start out at 16px, the same as most other icons. Since the pickerIcon in these cases is outside of the control-border, it is scaled to match the control since that's what it's adjacent to, via the sizeIncrease, not the fontIncrease like most other icons (such as SelectItem chevrons). You'll also note that MiniDateRangeItem scales it's picker a bit less (60% of the sizeIncrease, instead of 100%), because that usage is inline, inside the control, and we wanted to leave some space.

            We may make some minor changes here, and we'll let you know if we do.

            If you want to modify these defaults in your own skins, see the calls to <i>Canvas.registerIconSizingAttributes()</i> near the top of load_skin.js.

            Comment


              #7
              Thank you very much for the explanations. The WARN is not an issue for me.

              Regarding the icons, I was thinking that in my case it would actually be more appropriate to have it inline, but I noticed that with useTextField set to true, inline has no effect. Is that expected?

              Here’s the test case (the icon remains outside the textBox):

              Code:
              isc.DynamicForm.create({
                  width: 400,
                  margin: 10,
                  titleWidth: 100,
                  colWidths: [110, "*"],
                  autoFocus: true,
                  fields: [
                      { name: "datePicker",type:"date", title: "Date Picker", useTextField:true, icons: [ {inline:true, src:"Cancel"} ] }
                  ]
              });

              Comment


                #8
                It's probably something we should handle better, but you can fix it for now by applying the icons directly to the text-field, like

                Code:
                useTextField: true,
                textFieldProperties: { icons: [ {inline:true, src:"Cancel"} ] }  }
                Last edited by Isomorphic; 26 Aug 2025, 23:46.

                Comment

                Working...
                X