Skip to content

Conversation

buchen
Copy link
Member

@buchen buchen commented Sep 14, 2025

  • always show the buttons of the toolbar at the right side
  • at least show one view item for the view (plus the chevron), but if the title is shorter, show more
  • show as much as possible of the title

Issue: #4975

* always show the buttons of the toolbar at the right side
* at least show one view item for the view (plus the chevron), but if
  the title is shorter, show more
* show as much as possible of the title

Issue: #4975
@buchen
Copy link
Member Author

buchen commented Sep 14, 2025

@mierin12 I tried to implement (with the help of Claude Code) the layout.

But for whatever reason, every once in a while it does not render right - see screenshot. I also did not test on Linux yet.
Bildschirmfoto 2025-09-14 um 17 30 00

@mierin12
Copy link
Contributor

Haa, thanks a lot ! I will try to look in details to see if I can understand the idea and see if I can help, here is what I have seen (on Windows):

  • In Taxonomy: I think this works perfectly !
  • In Payment : a bit weird, we can lose the Dividend/Interest/Closed position tabs.
  • In Performance/Securities: a bit weird too now, while the name of the grouped account filter is not supposed to impact the title, so there is a side effect here I think
  • In Performance/Calculation : I think this works perfectly !
  • In Performance/Dashboard : same as Performance/Securities, there is a side effect on the tabs
  • In Statement of Asset/Holding : it works, but there is a horizontal cut on the title. This Cut is also visible in the All Transactions/Investment Plan/Securities Accounts/All Securities etc view. quite strange.
Capture d’écran 2025-09-16 210321

I will try to look into it this week, but it does not seem easy at all.

Copy link
Contributor

@mierin12 mierin12 left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Hello, I made two propositions of change, also visible here (easier to see the green/red intended changes): feature/adaptive_header_layout...mierin12:portfolio:pr-4980-fix

I tried a bit on Windows11, it looks ok to me. :) But Linux I do not know, and there may subtle changes that are hard to see, I did not saw the Payment's toolbar being not centered yesterday for example, only today.

Comment on lines +112 to +131
int y = marginHeight + (availableHeight - actionSize.y) / 2;

// title at left
titleLabel.setBounds(marginWidth, y, titleWidth, actionSize.y);

// Action toolbar at right
int actionX = bounds.width - marginWidth - actionWidth;
actionToolbar.setBounds(actionX, y, actionWidth, actionSize.y);

// View toolbar between title and action toolbar (right-aligned within
// its space)
int viewX = actionX - HORIZONTAL_SPACING - viewActualWidth;
viewToolbarWrapper.setBounds(viewX, marginHeight, viewActualWidth, availableHeight);

// Update the view toolbar wrapper's layout with the actual available
// width
if (viewToolbarWrapper.getLayout() instanceof ToolBarPlusChevronLayout layout)
{
layout.setMaxWidth(viewActualWidth);
}
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Suggested change
int y = marginHeight + (availableHeight - actionSize.y) / 2;
// title at left
titleLabel.setBounds(marginWidth, y, titleWidth, actionSize.y);
// Action toolbar at right
int actionX = bounds.width - marginWidth - actionWidth;
actionToolbar.setBounds(actionX, y, actionWidth, actionSize.y);
// View toolbar between title and action toolbar (right-aligned within
// its space)
int viewX = actionX - HORIZONTAL_SPACING - viewActualWidth;
viewToolbarWrapper.setBounds(viewX, marginHeight, viewActualWidth, availableHeight);
// Update the view toolbar wrapper's layout with the actual available
// width
if (viewToolbarWrapper.getLayout() instanceof ToolBarPlusChevronLayout layout)
{
layout.setMaxWidth(viewActualWidth);
}
var titleSize = titleLabel.computeSize(SWT.DEFAULT, SWT.DEFAULT, flushCache);
var viewSize = viewToolbarWrapper.computeSize(SWT.DEFAULT, SWT.DEFAULT, flushCache);
int yTitle = marginHeight + (availableHeight - titleSize.y) / 2;
int yAction = marginHeight + (availableHeight - actionSize.y) / 2;
int yView = marginHeight + (availableHeight - viewSize.y) / 2;
// title at left
titleLabel.setBounds(marginWidth, yTitle, titleWidth, titleSize.y);
// Action toolbar at right
int actionX = bounds.width - marginWidth - actionWidth;
actionToolbar.setBounds(actionX, yAction, actionWidth, actionSize.y);
// Update the view toolbar wrapper's layout with the actual available
// width
if (viewToolbarWrapper.getLayout() instanceof ToolBarPlusChevronLayout layout)
{
layout.setMaxWidth(viewActualWidth);
}
// View toolbar between title and action toolbar (right-aligned within
// its space)
int viewX = actionX - HORIZONTAL_SPACING - viewActualWidth;
viewToolbarWrapper.setBounds(viewX, yView, viewActualWidth, viewSize.y);

Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Proposition :

  • for the height, each one of the 3 should to be centered compared to its own height, here actionSize.y was used for more than the action Toolbar, and viewToolbar not centered. I think this fix the "horizontally cut title" and the not centered viewToolBar in Payment.
  • create the viewToolBar after setMaxWidth. I think setMaxWidth itselft does not retrigger a layout update.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants