Hello!
I am using the TAdvSmoothDatePicker and setting the size of the calendar and the font sizes depending on the current font size of the form.
This works well, when the monitor scaling (windows setting) is at 100%.
When it's set > 100%, and the form doesnt follow that PPI, then the font sizes of the calenderpopup gets very large.
Here the weeknumbers appear not scaled and the panel of the weeknumbers is too high.
Please check its layout.
If I reduce the font size in proportion to the monitor scaling, I achieve roughly the desired result.
Is the scaling calculated by the monitor PPI?
Should/could it rather be calculated by the PPI of the form?
Then the calendar layout would fit to the form.
Thanks
Björn
Thanks for reporting. We have seen a couple of issues in TAdvSmoothCalendar and TAdvSmoothDatePicker with newer Delphi versions and have applied several improvements. These improvements will be part of the next TMS VCL UI Pack release.
There were several improvements, but I still have issues with sizes on monitors with high scale (by Windows monitor settings).
I place an TAdvSmoothDatePicker on the form during runtime (having some conditions)
bool isInitial = !_datePickerPopup;
if (isInitial)
{
_datePickerPopup = new TAdvSmoothDatePicker((TComponent*)NULL);
_datePickerPopup->OnSelectDate = onCalendarDatePicked;
_datePickerPopup->Visible = false; //< I dont use the Calenderedit, but the popup. The calender is opened by calling ->DropDown when needed
_datePickerPopup->Name = "FormsDatePicker";
_datePickerPopup->Width = 0;
_datePickerPopup->Height = 0;
}
_datePickerPopup->Parent = edit->Parent;
_datePickerPopup->Left = edit->Left;
_datePickerPopup->Top = edit->Top;
_datePickerPopup->Font->Assign(edit->Font);
initCalendarPopup(_datePickerPopup); //< Setting popup size and font sizes
I use the font(size) from an Edit on the form. So the font sizes are scaled at that point.
On the first time opening the calender (_datePickerPopup->DropDown), the font sizes and calender proportions are way bigger than specified.
On the second time opening, the sizes are fine.
I assume, the first time the calender performs some PPI scaling on itself?
How should I deal with the sizing?
On a simple Project with a TAdvSmoothDatePicker embedded, similar behavior can be seen. The first time opening the calendar, the font sizes are fine, the next time its much smaller.
Tested on C++Builder Tokyo and TMS 13.5.13.0
Thanks
Björn
IssueSample.zip (58.1 KB)
Please note that the fonts used on the calendar dropdown itself are controlled by:
AdvSmoothDatePicker.Calendar.DateAppearance.*Font settings
so, if you want to programmatically control this, please change these font settings.
Please note that the fonts used on the calendar dropdown itself are controlled by:
AdvSmoothDatePicker.Calendar.DateAppearance.*Font settings
so, if you want to programmatically control this, please change these font settings.
I do use these settings.
And I set the same values for the font size before opening the calender popup. Same code, same font sizes.
On the first time shown, the font sizes are scaled much bigger than specified.
On the second time the font sizes are about the specified values.
First time:
Second time:
The same can be seen with an embedded (non runtime created control)
First time opened:
Second time opened.
I cant figure out how to provide a stable user experience.
I assume after an DPI change of the app, some scaling is applied.
After moving the app to a monitor with different DPI, the same behaviour can be seen again.
I adapted the demo application to show both ways.
But I think its not related to the dynamic embedding.
issueDemo2.zip (294.5 KB)