Size based on component duration and a fixed height
509545
def sizeHint(self, option, index):
        """"""
        # calculate size by data component
        component = index.internalPointer()
        width = self.component.duration() * self.pixelsPerms*1000
        return QtCore.QSize(width, 50)
237793
function(width, height) {
        var gutter = (this.options.gutter * 2),
            wWidth = $(window).width() - gutter,
            wHeight = $(window).height() - gutter,
            ratio,
            diff;

        // Resize if the width is larger
        if (width > wWidth) {
            ratio = (width / height);
            diff = (width - wWidth);

            width = wWidth;
            height -= Math.round(diff / ratio);
        }

        // Resize again if the height is larger
        if (height > wHeight) {
            ratio = (height / width);
            diff = (height - wHeight);

            width -= Math.round(diff / ratio);
            height = wHeight;
        }

        this.items.css({
            width: width,
            height: height
        });
    }
304535
function (width, height) {
            var cfg = this._cfg;
            cfg.width = width;
            cfg.height = height;
        }
566621
function() {
		var minItemWidth = this.layoutManager.config.dimensions ? (this.layoutManager.config.dimensions.minItemWidth || 0) : 0,
			sizeData = null,
			entriesOverMin = [],
			totalOverMin = 0,
			totalUnderMin = 0,
			remainingWidth = 0,
			itemSize = 0,
			contentItem = null,
			reducePercent,
			reducedWidth,
			allEntries = [],
			entry;

		if( this._isColumn || !minItemWidth || this.contentItems.length <= 1 ) {
			return;
		}

		sizeData = this._calculateAbsoluteSizes();

		/**
		 * Figure out how much we are under the min item size total and how much room we have to use.
		 */
		for( var i = 0; i < this.contentItems.length; i++ ) {

			contentItem = this.contentItems[ i ];
			itemSize = sizeData.itemSizes[ i ];

			if( itemSize < minItemWidth ) {
				totalUnderMin += minItemWidth - itemSize;
				entry = { width: minItemWidth };

			}
			else {
				totalOverMin += itemSize - minItemWidth;
				entry = { width: itemSize };
				entriesOverMin.push( entry );
			}

			allEntries.push( entry );
		}

		/**
		 * If there is nothing under min, or there is not enough over to make up the difference, do nothing.
		 */
		if( totalUnderMin === 0 || totalUnderMin > totalOverMin ) {
			return;
		}

		/**
		 * Evenly reduce all columns that are over the min item width to make up the difference.
		 */
		reducePercent = totalUnderMin / totalOverMin;
		remainingWidth = totalUnderMin;
		for( i = 0; i < entriesOverMin.length; i++ ) {
			entry = entriesOverMin[ i ];
			reducedWidth = Math.round( ( entry.width - minItemWidth ) * reducePercent );
			remainingWidth -= reducedWidth;
			entry.width -= reducedWidth;
		}

		/**
		 * Take anything remaining from the last item.
		 */
		if( remainingWidth !== 0 ) {
			allEntries[ allEntries.length - 1 ].width -= remainingWidth;
		}

		/**
		 * Set every items size relative to 100 relative to its size to total
		 */
		for( i = 0; i < this.contentItems.length; i++ ) {
			this.contentItems[ i ].config.width = (allEntries[ i ].width / sizeData.totalWidth) * 100;
		}
	}
649759
function proportionalSize(box, width, height) {
  if (height == null)
    height = box.height / box.width * width
  else if (width == null)
    width = box.width / box.height * height

  return {
    width:  width
  , height: height
  }
}
385419
def _fits_surface(self, width, height):
        
        assert(width > 0 and height > 0)
        if self.rot and (width > self.width or height > self.height):
            width, height = height, width

        if width > self.width or height > self.height:
            return False
        else:
            return True
846967
@Override protected void resize() {
        width  = clock.getWidth() - clock.getInsets().getLeft() - clock.getInsets().getRight();
        height = clock.getHeight() - clock.getInsets().getTop() - clock.getInsets().getBottom();

        if (aspectRatio * width > height) {
            width = 1 / (aspectRatio / height);
        } else if (1 / (aspectRatio / height) > width) {
            height = aspectRatio * width;
        }

        centerX = width * 0.5;
        centerY = height * 0.5;

        if (width > 0 && height > 0) {
            pane.setMaxSize(width, height);
            pane.relocate((clock.getWidth() - height) * 0.5, (clock.getHeight() - height) * 0.5);

            canvas.setWidth(width);
            canvas.setHeight(height);
        }
    }
789753
function(width, height, animate) {

		if (width) {
			this.options.width = width;
		}
		if (height && height != this.options.height) {
			this.options.height = height;
			this.timescale = this._getTimeScale();
		}

		// Size Markers
		this._assignRowsToMarkers();

		// Size swipable area
		this._el.slider_background.style.width = this.timescale.getPixelWidth() + this.options.width + "px";
		this._el.slider_background.style.left = -(this.options.width/2) + "px";
		this._el.slider.style.width = this.timescale.getPixelWidth() + this.options.width + "px";

		// Update Swipable constraint
		this._swipable.updateConstraint({top: false,bottom: false,left: (this.options.width/2),right: -(this.timescale.getPixelWidth() - (this.options.width/2))});

		// Go to the current slide
		this.goToId(this.current_id, true);
	}
1342132
function (cfg) {
            var size = {}, totalHeight, initDimension, skinObj = this._skinObj;

            this._panelBorderH = this._calculateBorderSize(skinObj.panelBorder, "H");
            this._panelBorderV = this._calculateBorderSize(skinObj.panelBorder, "V");

            this._separatorBorderH = this._calculateBorderSize(skinObj.separatorBorder, "H");
            this._separatorBorderV = this._calculateBorderSize(skinObj.separatorBorder, "V");

            if (cfg.border) {
                this._containerBorderH = (skinObj.borderWidth || skinObj.borderWidth === 0)
                        ? skinObj.borderWidth * 2
                        : this._skinObj.borderTopWidth + this._skinObj.borderBottomWidth;
                this._containerBorderV = (skinObj.borderWidth || skinObj.borderWidth === 0)
                        ? skinObj.borderWidth * 2
                        : this._skinObj.borderLeftWidth + this._skinObj.borderRightWidth;
            }

            this._height = cfg.height - skinObj.separatorHeight - this._separatorBorderH - this._panelBorderH * 2
                    - this._containerBorderH;
            this._width = cfg.width - skinObj.separatorWidth - this._separatorBorderV - this._panelBorderV * 2
                    - this._containerBorderV;

            if (this._height < 0) {
                this._height = 0;
            }
            if (this._width < 0) {
                this._width = 0;
            }

            if (cfg.size1 < 0) {
                cfg.size1 = 0;
            }
            if (cfg.size2 < 0) {
                cfg.size2 = 0;
            }

            initDimension = this._orientation ? this._height : this._width;
            if (cfg.size1 == null && cfg.size2 == null) {
                cfg.size1 = Math.floor(initDimension / 2);
                cfg.size2 = initDimension - cfg.size1;
            } else if (cfg.size1 == null && cfg.size2 != null) {
                cfg.size1 = initDimension - cfg.size2;
            } else if (cfg.size1 != null && cfg.size2 == null) {
                cfg.size2 = initDimension - cfg.size1;
            }

            totalHeight = cfg.size1 + cfg.size2;
            if (initDimension == totalHeight) {
                size.size1 = cfg.size1;
                size.size2 = cfg.size2;
            } else {
                if (cfg.adapt == "size1") {
                    size.size2 = cfg.size2;
                    if (size.size2 > initDimension) {
                        size.size2 = initDimension;
                    }
                    size.size1 = initDimension - size.size2;
                } else if (cfg.adapt == "size2") {
                    size.size1 = cfg.size1;
                    if (size.size1 > initDimension) {
                        size.size1 = initDimension;
                    }
                    size.size2 = initDimension - size.size1;
                } else {
                    if (totalHeight !== 0) {
                        size.size1 = Math.floor((initDimension * cfg.size1) / totalHeight);
                        size.size2 = initDimension - size.size1;
                    } else {
                        size.size1 = Math.floor(initDimension / 2);
                        size.size2 = initDimension - cfg.size1;
                    }

                }
            }
            return size;
        }
521508
def setFixedHeight(self, height):
        
        super(XView, self).setFixedHeight(height)
        
        if ( not self.signalsBlocked() ):
            self.sizeConstraintChanged.emit()
814643
function( width, height ) {
		if( width !== this.width || height !== this.height ) {
			this.width = width;
			this.height = height;
			this._contentElement.width( this.width ).height( this.height );
			this.emit( 'resize' );
		}
	}
642454
function (width, height, canvas) {
            // XXX This should probably be a configurable option
            var match;
            match = this._pxregex.exec(height);
            if (match) {
                this.pixelHeight = match[1];
            } else {
                this.pixelHeight = $(canvas).height();
            }
            match = this._pxregex.exec(width);
            if (match) {
                this.pixelWidth = match[1];
            } else {
                this.pixelWidth = $(canvas).width();
            }
        }
266809
function() {
        canvasWidth = $(window).width();
        canvasHeight = $(window).height();
        if (supportsCanvas) {
          $canvas[0].width = canvasWidth;
          $canvas[0].height = canvasHeight;
        }
        $container.width(canvasWidth);
        $container.height(canvasHeight);
      }
886108
def _fixSize(self):
        """"""
        self.height = 0
        for o in self.options:
            text = o['label']
            font = o['font']
            ren = font.render(text, 1, (0, 0, 0))
            if ren.get_width() > self.width:
                self.width = ren.get_width()
            self.height += font.get_height()
1014190
function (size) {
        this.canvasContext.canvas.width = size.w;
        this.canvasContext.canvas.height = size.h;

        this.size = size;
    }
991846
function getIconSize(props) {
  const { spacing } = props.theme;
  const { icon } = props.style;

  if (icon && icon.width) {
    return icon.width;
  }
  if (props.size) {
    return props.size;
  }

  return spacing.iconSize;
}
556914
function() {
		var i,
			totalSplitterSize = (this.contentItems.length - 1) * this._splitterSize,
  		headerSize = this.layoutManager.config.dimensions.headerHeight,
			totalWidth = this.element.width(),
			totalHeight = this.element.height(),
			totalAssigned = 0,
			additionalPixel,
			itemSize,
			itemSizes = [];

		if( this._isColumn ) {
			totalHeight -= totalSplitterSize;
		} else {
			totalWidth -= totalSplitterSize;
		}
		for( i = 0; i < this.contentItems.length; i++ ) {
			if( this._isDocked( i ) )
				if( this._isColumn ) {
					totalHeight -= headerSize - this._splitterSize;
				} else {
					totalWidth -= headerSize - this._splitterSize;
				}
		}

		for( i = 0; i < this.contentItems.length; i++ ) {
			if( this._isColumn ) {
				itemSize = Math.floor( totalHeight * ( this.contentItems[ i ].config.height / 100 ) );
			} else {
				itemSize = Math.floor( totalWidth * (this.contentItems[ i ].config.width / 100) );
			}
			if( this._isDocked( i ) )
				itemSize = headerSize;

			totalAssigned += itemSize;
			itemSizes.push( itemSize );
		}

		additionalPixel = Math.floor( (this._isColumn ? totalHeight : totalWidth) - totalAssigned );

		return {
			itemSizes: itemSizes,
			additionalPixel: additionalPixel,
			totalWidth: totalWidth,
			totalHeight: totalHeight
		};
	}