Results 1 to 5 of 5

Thread: TitleBar text truncation is not updated when the toolbar is hidden

  1. #1
    Sencha User
    Join Date
    Apr 2012
    Posts
    11
    Vote Rating
    0
      0  

    Default TitleBar text truncation is not updated when the toolbar is hidden

    I have a TitleBar with several buttons. If the screen is not wide enough to fit the title and the buttons, it will rightly truncate the title, e.g. if the title is "My Long Title":

    [BUTTON] My Lon... [BUTTON]

    However, let's say the screen is in landscape mode and it can fit the whole title. Then, I hide the toolbar, rotate the device, and show the toolbar. Now it can't fit the whole title, but it is not updated so the title overlaps one of the buttons.

    Is this a bug? Or if it's by design, then how I can I override the behavior so that it will update the toolbar when I show it?

  2. #2
    Sencha - Sr Software Engineer mitchellsimoens's Avatar
    Join Date
    Mar 2007
    Location
    Gainesville, FL
    Posts
    39,556
    Answers
    3932
    Vote Rating
    1272
      0  

    Default

    The TitleBar has to calculate the width of the text but when it's hidden it doesn't really have a width.
    Mitchell Simoens @LikelyMitch
    Sencha Inc, Senior Software Engineer
    ________________
    Learn BBCode and use it! Checkout the CODE tag!

    Check out my GitHub, lots of nice things for Ext JS and Sencha Touch
    https://github.com/mitchellsimoens

  3. #3
    Sencha User
    Join Date
    Apr 2012
    Posts
    11
    Vote Rating
    0
      0  

    Default

    So how do I get it to recalculate the text width after I show it?

  4. #4
    Sencha User
    Join Date
    Mar 2012
    Location
    The Netherlands
    Posts
    75
    Answers
    13
    Vote Rating
    4
      0  

    Default

    I believe the private method refreshTitlePosition() does what you want. In my case i had to call it with a small delay after showing the titlebar. Please mind that the use of private methods of ST is discouraged.
    http://docs.sencha.com/touch/2-0/#!/api/Ext.TitleBar-method-refreshTitlePosition

  5. #5
    Ext JS Premium Member
    Join Date
    Oct 2010
    Location
    West Germany
    Posts
    65
    Vote Rating
    5
      0  

    Default

    Do update to ST 2.1

    Cheers, Oleg

Posting Permissions

  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts
  •