mirror of
https://gitlab.freedesktop.org/gstreamer/gstreamer.git
synced 2024-12-29 19:50:40 +00:00
columns: cleanup default size calculation
Some unused parameters here.
This commit is contained in:
parent
ae75acd50d
commit
c2eddd8db4
1 changed files with 8 additions and 11 deletions
|
@ -54,7 +54,7 @@ class SizedColumn (Column):
|
||||||
|
|
||||||
default_size = None
|
default_size = None
|
||||||
|
|
||||||
def compute_default_size (self, view, model):
|
def compute_default_size (self):
|
||||||
|
|
||||||
return None
|
return None
|
||||||
|
|
||||||
|
@ -109,11 +109,11 @@ class TextColumn (SizedColumn):
|
||||||
cell.props.text = modify_func (model.get (tree_iter, id_)[0])
|
cell.props.text = modify_func (model.get (tree_iter, id_)[0])
|
||||||
column.set_cell_data_func (cell, cell_data_func)
|
column.set_cell_data_func (cell, cell_data_func)
|
||||||
|
|
||||||
def compute_default_size (self, view, model):
|
def compute_default_size (self):
|
||||||
|
|
||||||
values = self.get_values_for_size ()
|
values = self.get_values_for_size ()
|
||||||
if not values:
|
if not values:
|
||||||
return SizedColumn.compute_default_size (self, view, model)
|
return SizedColumn.compute_default_size (self)
|
||||||
|
|
||||||
cell = self.view_column.get_cell_renderers ()[0]
|
cell = self.view_column.get_cell_renderers ()[0]
|
||||||
|
|
||||||
|
@ -602,19 +602,17 @@ class ViewColumnManager (ColumnManager):
|
||||||
if self.view is None:
|
if self.view is None:
|
||||||
return
|
return
|
||||||
|
|
||||||
model = self.view.get_model ()
|
|
||||||
|
|
||||||
# Timestamp and log level columns are pretty much fixed size, so resize
|
# Timestamp and log level columns are pretty much fixed size, so resize
|
||||||
# them back to default on zoom change:
|
# them back to default on zoom change:
|
||||||
for column in self.columns:
|
for column in self.columns:
|
||||||
if column.name in (TimeColumn.name,
|
if column.name in (TimeColumn.name,
|
||||||
LevelColumn.name):
|
LevelColumn.name):
|
||||||
self.size_column (column, self.view, model)
|
self.size_column (column)
|
||||||
|
|
||||||
def size_column (self, column, view, model):
|
def size_column (self, column):
|
||||||
|
|
||||||
if column.default_size is None:
|
if column.default_size is None:
|
||||||
default_size = column.compute_default_size (view, model)
|
default_size = column.compute_default_size ()
|
||||||
else:
|
else:
|
||||||
default_size = column.default_size
|
default_size = column.default_size
|
||||||
# FIXME: Abstract away fixed size setting in Column class!
|
# FIXME: Abstract away fixed size setting in Column class!
|
||||||
|
@ -628,8 +626,7 @@ class ViewColumnManager (ColumnManager):
|
||||||
def _add_column (self, column):
|
def _add_column (self, column):
|
||||||
|
|
||||||
result = ColumnManager._add_column (self, column)
|
result = ColumnManager._add_column (self, column)
|
||||||
model = self.view.get_model ()
|
self.size_column (column)
|
||||||
self.size_column (column, self.view, model)
|
|
||||||
return result
|
return result
|
||||||
|
|
||||||
def _remove_column (self, column):
|
def _remove_column (self, column):
|
||||||
|
@ -647,7 +644,7 @@ class ViewColumnManager (ColumnManager):
|
||||||
return
|
return
|
||||||
self.logger.debug ("model changed, sizing columns")
|
self.logger.debug ("model changed, sizing columns")
|
||||||
for column in self.iter_items ():
|
for column in self.iter_items ():
|
||||||
self.size_column (column, view, model)
|
self.size_column (column)
|
||||||
self.columns_sized = True
|
self.columns_sized = True
|
||||||
|
|
||||||
class WrappingMessageColumn (MessageColumn):
|
class WrappingMessageColumn (MessageColumn):
|
||||||
|
|
Loading…
Reference in a new issue