~manishsinha/gnome-activity-journal/fixes-924988

« back to all changes in this revision

Viewing changes to src/histogram.py

  • Committer: Bazaar Package Importer
  • Author(s): Siegfried-Angel Gevatter Pujals, Siegfried-Angel Gevatter Pujals, Manish Sinha
  • Date: 2011-07-16 19:12:03 UTC
  • mfrom: (1.2.1 upstream) (5.1.1 experimental)
  • mto: This revision was merged to the branch mainline in revision 7.
  • Revision ID: james.westby@ubuntu.com-20110716191203-wotprinloexpofrs
[ Siegfried-Angel Gevatter Pujals ]
* New upstream releases (Closes: #621011) (LP: #643795, #722227, #734412,
  #743054, #743125, #650917).
* debian/postinst:
   - Restart zeitgeist-daemon after installation, to ensure that
     the extension gets loaded (LP: #638217).
* debian/control:
   - Bump Zeitgeist dependency to 0.8.0.
   - Remove Tracker from Suggests, support for it has been disabled
     for now.
   - Bump Standards-Version to 3.9.2.
* debian/rules:
   - Remove build/ directory on clean.
* debian/copyright:
   - Update copyright years and add Stefano Candori and Collabora.

[ Manish Sinha ]
* debian/control:
   - Add Recommends on gstreamer0.10-plugins-base (LP: #705545).

Show diffs side-by-side

added added

removed removed

Lines of Context:
142
142
 
143
143
    def set_store(self, store):
144
144
        self._store = store
145
 
        self.largest = min(max(max(map(lambda x: len(x), store.days)), 1), 100)
 
145
        self.largest = min(max(max(map(lambda x: len(x), store.days)), 1), 200)
146
146
        if not self.get_selected():
147
147
            self.set_selected([datetime.date.today()])
148
148
        else:
201
201
        """
202
202
        x = self.start_x_padding
203
203
        months_positions = []
204
 
        for day in self.get_store().days:
 
204
        for day in self.get_store().days:            
205
205
            if day.date.day == 1:
206
206
                months_positions += [(day.date, x)]
207
207
            if day.date in self._highlighted:
231
231
        :param nitems: The number of items in the column to be drawn
232
232
        :param color: A RGBA tuple Example: (0.3, 0.4, 0.8, 1)
233
233
        """
234
 
        if nitems < 2:
235
 
            nitems = 2
236
 
        elif nitems > self.max_column_height:
 
234
        if nitems > self.max_column_height:
237
235
            nitems = self.max_column_height
238
236
        maxheight = maxheight - self.bottom_padding - 2
239
 
        #height = int((maxheight-self.top_padding-2) * (self.largest*math.log(nitems)/math.log(self.largest))/100)
240
 
        height = int(((float(nitems)/self.largest)*(maxheight-2))) - self.top_padding
241
 
        #height = min(int((maxheight*self.largest/100) * (1 - math.e**(-0.025*nitems))), maxheight)
 
237
        height = int((((float(nitems)/self.largest)**0.33)*(maxheight-2))) - self.top_padding
242
238
        if height < self.min_column_height:
243
239
            height = self.min_column_height
244
240
        y = maxheight - height
488
484
                           (gobject.TYPE_PYOBJECT,)),
489
485
        }
490
486
 
491
 
    def __init__(self, histo_type=CairoHistogram, size = (600, 75)):
 
487
    def __init__(self, histo_type=CairoHistogram):
492
488
        """
493
489
        :param histo_type: a :class:`CairoHistogram <CairoHistogram>` or a derivative
494
490
        """
495
491
        super(HistogramWidget, self).__init__()
 
492
        screen = self.get_screen()
 
493
        if screen.get_width() < 1280:
 
494
            size = (600, 55)
 
495
        else:
 
496
            size = (600, 75)
 
497
 
496
498
        self.set_shadow_type(gtk.SHADOW_NONE)
497
499
        self.histogram = histo_type()
498
500
        self.eventbox = TooltipEventBox(self.histogram, self)