You would set that with a Set Size action. But first you need to determine what event should trigger it. It could be a an event that results from a user action (OnClick) or a passive event (OnPageLoad).
Let’s assume you want the size to be set at soon as the page loads. You could use the widget’s OnLoad event. Add a case to the event. Double click the case to open the case editor and add a Set Size action. Choose the widget you want to adjust (since you’re using the widget’s own OnLoad case you can just choose “This Widget” from the widget selection). You should see the height and width fields below the target widget selection for the Set Size action. Enter the expressions I posted above. Make sure the variable you use either has a default value or a value set by some other action before the page loads.