Commit Graph

750 Commits

Author SHA1 Message Date
0d8f45f034 visualizer-ticks: draw position labels next to ticks
This adds label text next to important epochs. We determine
which epochs are important by trying to choose the waypoints
that had more than 2 epochs land in view.

This avoids showing numbers for multiple time-spans, but giving
enough context to be useful.
2016-09-30 16:54:17 -07:00
a20ba80f3d line-visualizer-row: disable time optimization
This is overactive because we could be zoomed in so far that we
don't pick up the adjacent frame. We need something more clever
that can pick up frames adjacent to the visible area of the
capture.
2016-09-30 14:02:58 -07:00
879d00199a window: add tooltips 2016-09-30 13:55:53 -07:00
bd008c0826 app: add accels for zoom actions
Adds ctrl++, ctrl+-, and ctrl+0 for typical zoom operations on
the visualizers.
2016-09-30 13:29:09 -07:00
c116120563 visualizer-ticks: adjust ticks for capture epoch
We need to take into account the real start of the capture to
land the ticks in the right position. Add "epoch" concept
to SpVisualizerTicks for just this purpose.
2016-09-30 13:21:17 -07:00
54116ba765 sysprof-ui: make SpVisualizerTicks and SpVisualizerList private
This classes are implementation details and should not be
exposed into our public API/ABI.
2016-09-30 13:09:13 -07:00
428cbcbfbb sysprof-ui: add SpMultiPaned to public API
This adds sp-multi-paned.h to the public API of libsysprof-ui-2
2016-09-30 13:01:57 -07:00
2d8401a542 window: use SpMultiPaned
This allows us to have the SpVisualizerView grow and shrink
along with the visualizer content up until the user has manually
moved the paned handle. At which point it clamps to that
position as allowed by the size request phases.
2016-09-30 13:00:31 -07:00
d64bd3fe51 visualizer-view: set vexpand on scrolledwindow
This ensures that the scrolled window expands to the visible
area, which is indeed the desired effect.
2016-09-30 12:59:57 -07:00
f9e19131b5 multi-paned: add SpMultiPaned
This is copy/paste from PnlMultiPaned. The feature we want from
it is the ability to resize paned halves based on their natural
sizing up until the user has manually changed the paned handle
position.
2016-09-30 12:59:09 -07:00
69d5dd2f5f avoid warnings on shutdown
Occasionally we could get a few warnings during shutdown due
to inconsistent teardown state. This tries to handle those so
we shutdown cleanly.
2016-09-30 10:54:53 -07:00
fa58f7a941 visualizer-view: hide scrollbar by default 2016-09-29 18:14:50 -07:00
4bd72708d7 line-visualizer-row: handle HiDPI properly
When we find ourselves on a HiDPI display, we need to make sure
we setup the device scale factor properly and adjust our render
checks for valid surface sizes.
2016-09-29 18:13:35 -07:00
75332678a6 visualizer-view: dynamically toggle scrollbar visibility
Generally we want this thing hidden, so only show it if we have
zoomed in enough to cause it to be useful.

We need to also find a way for the container to be able to
handle the change in size request and adjust the GtkPaned
to be non-ugly.
2016-09-29 17:49:53 -07:00
0766bd6b93 line-visualizer-row: restrict data points to visible range
We don't want to cache all the datapoints from the underlying
capture, just the datapoints for the visible region (and some
at the edges so we get proper cairo_curve_to() x,y coordinates).

This isn't a major optimization yet until we start supporting
much larger capture sizes. But that will mostly be improved with
capture indexes anyway.
2016-09-29 14:59:02 -07:00
caa95fcca7 visualizer-view: implement basic panning
There are lots of little things that need fixing, such as the
ticks positioning, and reusing surfaces as much as possible, but
this gets our "MVP" panning in place.
2016-09-29 14:37:00 -07:00
342ee71119 window: add separators in gear menu 2016-09-28 21:02:01 -07:00
b9b96184cd visualizers: wire zoom manager to visualizers
This gets the basic zoom control working. I anticipate we'll
need some additional changes once we land panning support.
2016-09-28 19:56:39 -07:00
aaf521ef1d window: set minimum zoom level 2016-09-28 18:11:32 -07:00
9bd3891d43 window: use floor() instead of ceil()
Otherwise we get 111% instead of 110%.
2016-09-28 18:08:34 -07:00
60e917a5d1 window: update zoom reset label to display current zoom 2016-09-28 18:06:33 -07:00
baf26fa0b6 build: add $LIBM to the sysprof binary 2016-09-28 18:06:00 -07:00
50bfd8db72 zoom: add plumbing for zoom to SpWindow
This uses the new ZoomManager to wire up zoom controls for the
main window. We had to switch away from GMenu to give ourselves
the control we will need for the zoom label of 100% which still
needs to be wired up.
2016-09-28 17:51:48 -07:00
e6ecad548a zoom-manager: add zoom manager to simplify zoom control
This will give us a single place to deal with the mechanics of
how zoom works, and then our UI code can simply apply the value
as necessary.
2016-09-28 17:13:24 -07:00
4d48f98f6d visualizer-ticks: remove extraneous assertion
This isn't exactly true anymore, so we need to remove it now
that we can have more interesting time spans.
2016-09-28 14:13:15 -07:00
7831b767d0 visualizer-view: shrink time range when necessary
If we don't have a minute worth of input, we should shrink the
visible area to exactly what we came across.

We still have the issue of the UI creating the capture file
before auth has completed, but we can fix that later so we
have a "semantically" correct start time.
2016-09-28 14:10:29 -07:00
527ad1476c cpu-visualizer: reset colors upon new reader
We want to reset our colors so that we look the same on
subsequent loads, which is what the user would expect.
2016-09-28 14:09:53 -07:00
baabf7692c color-cycle: add reset helper
This will reset the colors and move back to position 0.
2016-09-28 14:09:32 -07:00
388557cdfe window: expand for visualizers as necessary
We want the paned to expand for the visualizers so that the
UI looks natural as often as possible without scrolling.
2016-09-28 13:23:51 -07:00
b5fccca069 visualizer-view: add ::visualizer-added and ::visualizer-removed
These signals are emitted when a visualizer row has been added
or removed from the view. This might be handy if you want to
resize a paned based on the natural size of the visualizers.
2016-09-28 13:22:51 -07:00
337334e4fa visualizer-view: remove min height for rows
We will handle this in other areas, so we can drop this.
2016-09-28 13:22:25 -07:00
afbb2cd936 window: use GtkFileChooserNative
This helps remove gtk_dialog_run() in favor of
gtk_native_dialog_run() which safely handles issues with
the primary main loop making progress.
2016-09-28 12:30:29 -07:00
f8a0f2701e visualizer-view: add SpVisualizerView
This adds a new helper widget SpVisualizerView to simplify using
visualizers from applications using libsysprof-ui-2 such as
Builder.

We can manage the view range, zoom, etc from this widget going
forward.
2016-09-27 23:15:56 -07:00
2197a0c02e capture: add end time for captures
Update the end time when we flush the buffer to disk. Also add
a way to either incrementally get the end time or rely on the
header when possible.
2016-09-27 21:24:33 -07:00
4953731dd7 cpu-visualizer-row: choose color for row
For each CPU counter we come across, choose a new color from
the cycle.
2016-09-27 19:18:40 -07:00
f3cec0f8c1 line-visualizer-row: add color parameter for counter
Allow specifying a color for a counter that is added to the
visualizer.
2016-09-27 19:18:29 -07:00
e7e8e913b5 color-cycle: add color generator helper
We need a simple helper to choose colors for visualizers so
they do not overlap. This is just a simple cycle using some
predefined colors.

We should come up with something more unique in the future or
possibly do this with CSS and :nth-child(n) once we have access
to CSS nodes.
2016-09-27 19:16:07 -07:00
5a5bf1900f visualizer-ticks: adjust ticks opacity
We can lighten the ticks a bit here and still be theme agnostic.
2016-09-27 18:33:17 -07:00
21ed742215 line-visualizer-row: only queue draw when using widget style
We can avoid queuing a new draw request if we are not using
the default styling of the widget in the line drawing.
2016-09-27 18:30:55 -07:00
21db65167f line-visualizer-row: use default foreground to draw
When drawing lines, default to the foreground color of the
widget. This means we also need to queue a draw when the CSS
style has been updated.
2016-09-27 18:27:59 -07:00
7aee4c428b css: tweak css for visualizers
Just some style fixes that make things look better when playing
around with the paned and showing overscroll.
2016-09-27 17:22:05 -07:00
f2f03259a2 visualizer-ticks: set CSS element name to "ticks" 2016-09-27 17:21:49 -07:00
fa1a8d9276 visualizer-ticks: use color from GtkStyleContext
This should improve the coloring when used with a dark theme.
2016-09-27 17:21:28 -07:00
3a3b4f1fa0 visualizer-ticks: adjust line draw ordering
We want to draw the most important ticks on top, which will
improve things should we start using CSS to define styling.
2016-09-27 17:09:37 -07:00
857082b222 visualizer-ticks: tweak half-line positioning
Just to get things a bit more friendly should we choose even
line widths.
2016-09-27 17:08:52 -07:00
ad130db3d6 cpu-visualizer-row: hide if no counters were found
If we failed to locate any counters, then there isn't much we
can show the user here. So just hide the row.
2016-09-27 16:44:23 -07:00
984fac73b6 visualizer-ticks: adjust tick positioning and add 5sec span
Just some improvements to out positioning so things line up
as expected.
2016-09-27 16:38:17 -07:00
aa21c2379f visualizer-ticks: start on minimal ticks implementation
We need some sort of scale for content, so we will do this with
an overlay for now. However, we will also want something to be
able to do selections in the future.

This still needs some iteration for correctness, but this sort
of gets the ball rolling.
2016-09-27 15:42:26 -07:00
c24306349f line-visualizer-row: ignore css border
If a border is specified in CSS, we do not want to draw on
that. Make sure we adjust our allocation to take that into
account.
2016-09-27 15:40:46 -07:00
1dcb41f623 line-visualizer-row: use scaled surface when available
If we have not yet received our proper draw for the new size
allocation (likely right after the size allocate), then we can
just use the old surface but at a scaled value. This is handy
so that we don't block the main loop trying to do drawing of
lots of data points. Instead we just scale the image and wait
for the high-quality version to complete.
2016-09-26 23:24:17 -07:00