Calculating width of textbar based on the resize / close buttons