Commit Graph

17948 Commits

Author SHA1 Message Date
Robert Fewell
a6fd7f85d3 Set the background of the GncDenseCal Widget
The background of the GncDenseCal widget is not able to be set from the
default style. Set it white but allow it to be themed with css.
2017-06-15 19:40:20 +01:00
Robert Fewell
64deacf1e1 With Gtk3 it uses css to do the theming so change the file to load 2017-06-15 19:38:53 +01:00
Geert Janssens
dd9b2007b0 Gtk3: fix failing item-edit widget on sheets
There were several problems since the conversion to gtk3
* widget wasn't displayed at all - apparently this was because I had overriden the draw function of the gtklayout (sheet)
  -> fixed by adding a draw callback instead
* several gtk warnings about allocating sizes to widgets without using *get_preferred_width/height
  -> fixed by adding the itemedit dropdowns to the layout only when they are requested
* the arrow button didn't want to resize small enough
  -> fixed by adding a custom style to drops the button's internal padding
* there were several sizing issues which ironically got fixed dropping much of the custom sizing code
2017-04-14 19:23:19 +02:00
Geert Janssens
24ed305c18 Gtk3: fix register redrawing when the window is scrolled
The new drawing interface in gtk3 uses a different coordinate system.
Some calculations had to be adjusted to this.
2017-04-14 19:22:29 +02:00
Geert Janssens
3a76cb91f1 Gtk3: Fix register not being drawn - item_edit still missing
While the data is displayed the widget to edit the active cell isn't yet.
2017-04-14 19:21:35 +02:00
Geert Janssens
e5d2ab8dc5 Fix build with webkitgtk >= 2.8 2017-04-14 19:21:35 +02:00
John Ralls
d632abaa96 Get links working. 2017-04-14 19:21:35 +02:00
John Ralls
bb0376240d Get WebKit2Gtk basics compiling and working.
Copy and register links don't work.
2017-04-14 19:21:35 +02:00
John Ralls
15ef317968 Revert "Fix query period in test-account-get-trans-type-splits-interval."
This reverts commit e66dd12aa9. Because
the test only seems to fail crossing a DST boundary.
2017-04-14 19:21:34 +02:00
John Ralls
bf86524884 Correct gnc-html-webkit.c indentation. 2017-04-14 19:21:34 +02:00
Geert Janssens
8f66cf4286 Gtk3: Replace obsolete functions
gtk_statusbar_set_has_resize_grip
gdk_drawable_get_screen
gdk_device_get_core_pointer

There is no replacement for it in gtk3 and it's probably
not needed any more either.
2017-04-14 19:21:34 +02:00
Geert Janssens
e40acf5915 Temporarily disable deprecation warnings 2017-04-14 19:21:34 +02:00
John Ralls
89021dde39 Remove if-0-ed out code from gnc-html-webkit.c 2017-04-14 19:21:34 +02:00
Geert Janssens
87a0cb7360 Gtk3: fix direct access issue for entry widget in cell renderer mode
The old code directly accessed a member variable of GtkEntry. This
direct access is no longer possible, but there is no public function
to get/set this variable. There is a private one  used by
GtkComboBox internally) but it's not exported so it can't be used either.

As an interim solution I peeked at how hesiod handled it in his earlier
(unmerged) gtk3 branch. He replaced this private access with setting
gtk_widget_set_visible, something I wouldn't have considered in this
situation. The issue is in the register2 code, so for now it's not
too important. We can investigate this more when the register rewrite
is picked up again.
2017-04-14 19:21:34 +02:00
Geert Janssens
e26480ccbb Gtk3: Convert GdkColor into GdkRGBA
Only gnc-dense-cal.[ch] is left untouched because it's use
of color is tightly coupled to the use of GtkStyle. This
latter needs conversion as well, but would be too much to
add in one commit.

Additionally the register code uses GtkStyle to extract
colors. This has been partially converted to using GdkRGBA
with the inconvenient side effect that depending on how
a color is retrieved it has to be freed with gdk_rgba_free
or not. This may be cleaned up later.
2017-04-14 19:21:34 +02:00
Geert Janssens
f07ad114c4 Gtk3: replace expose_event size_request functions
expose_event has been replaced with draw
size_request has become get_preferred_width and get_preferred_height
2017-04-14 19:21:34 +02:00
Geert Janssens
2ca938bd67 Gtk3: Fix the remaining gtk direct access violations
These could not be fixed in Gtk2 because the accessor functions were only added as of Gtk3.
2017-04-14 19:21:34 +02:00
Geert Janssens
42264efd1b Gtk3: adapt to changed callback function signature 2017-04-14 19:21:34 +02:00
Geert Janssens
3065005f05 Gtk3: use CSS style instead of old GtkStyle interface 2017-04-14 19:21:20 +02:00
Geert Janssens
b9abc0b5ba Gtk3: Fix cursor handling 2017-03-31 14:04:31 +02:00
Geert Janssens
9b5fbcb2cb Gtk3: GtkObject has been removed
Replace with GtkWidget instead
2017-03-31 14:04:31 +02:00
Geert Janssens
2528bfde6b Switch to building with the gtk+-3.0 toolkit 2017-03-31 14:04:31 +02:00
Geert Janssens
6edbb53fe6 GnucashSheet - drop unused variables 2017-03-31 14:03:49 +02:00
Geert Janssens
4b30a7dae7 GnucashSheet - fix screen refresh
I noticed improper screen redraws when switching cells while the
window was scrolled down. The drawing logic is pretty conflated
so instead of hunting this down, I have made it so that the full
visible part of the windows gets redrawn each time the user
switches to a different cell.
This is slightly more expensive, but should still be ok.
2017-03-31 14:03:49 +02:00
Geert Janssens
d439d37980 Fix two critical GObject warnings 2017-03-31 14:03:49 +02:00
Geert Janssens
68091faa80 ItemEdit - drop unused function 2017-03-31 14:03:49 +02:00
Geert Janssens
03699efe14 Extract the GnucashRegister widget into a separate file
It was interleaved in the gnucash-sheet.* sources making it harder to examine
2017-03-31 14:03:49 +02:00
Geert Janssens
5223ca8c81 Restore pasting in the item_edit
The register is implemented such that the edit widget is read-only and
all keystrokes are filtered by the sheet widget which then directly sets
the appropriate text in the edit widget each time.
The interim fix here is to make the text edit widget temporarily editable
when cutting or pasting text.
A better solution will be to make the edit widget responsible for all
text entry and delegate everything not handled directly to the sheet widget.
This will be for a later commit
2017-03-31 14:03:49 +02:00
Geert Janssens
a3f8f69604 Rework GncItemEdit widget
Use real widgets instead of custom drawing something

In essence this is a gtkentry with an optional gtkbutton if the current cell
has a popup (like a calendar or account list). The old code went through
several hoops to keep a hidden gtkentry in sync with the custom drawn item
on screen.

There are still a few issues to fix:
- it's not properly themed to fit in the register. This will be fixed after switching to gtk3 (using css)
- right-click menu is wrong. This currenly shows a default copy/paste menu from a gtkentry
  it should be changed to show our own full menu
- keyboard events are still handled backwards. The sheet gets a first stab and passes
  on what it can't handle to the item edit. In the current implementation this means not
  all key strokes the item edit can handle are received (most notably paste is not working).
2017-03-31 14:03:49 +02:00
Geert Janssens
986720e6c3 Fix hidden scrollbars for itemlist type popup 2017-03-31 14:03:49 +02:00
Geert Janssens
efcb06e6a3 Fix crash in previously unreached code 2017-03-31 14:03:49 +02:00
Geert Janssens
131462ca41 Create specialized popup items their respective source files
The extracted function in gnc_item_edit was unneeded and confusing
2017-03-31 14:03:49 +02:00
Geert Janssens
58bfd3e1e9 Reduce the cursor from a full widget to a simple gobject that tracks cursor coordinates
As with the grid there is no direct interaction possible with the cursor.
It is merely decoration. It does keep track of coordinates so I've made
it a gobject for memory management. The actual drawing of the cursor
frame is now done by the sheet, just like for the grid.

This change also fixes the transparency issue in the cursor.
2017-03-31 14:03:49 +02:00
Geert Janssens
c54cf61cce Rework gnucash-cursor
- drop lots of unneeded complexity
- use cairo instead of gdk_gc to draw

Issue still to fix: the cursor widget has a grey background instead
of being transparent. I'm not sure this can be fixed before switching
to gtk3
2017-03-31 14:03:49 +02:00
Geert Janssens
6c06336d3e Reduce grid object from a complete widget to only two utility functions
There was no added value in it being a full widget. It only served two functions really
- speed draw the visible and non-editable part of a register window
- locating a cell starting from a pixel

Both are used exclusively by the sheet object, so
I have made them private functions of the sheet.
They are still kept in a separate file though for length considerations.
2017-03-31 14:03:49 +02:00
Geert Janssens
3025e30e4a Refactor divider line drawing some more to reduce duplicate code 2017-03-31 14:03:49 +02:00
Geert Janssens
93a03d19ee Use cairo to redraw the grid widget 2017-03-31 14:03:49 +02:00
Geert Janssens
4888d34554 Replace all other uses of GnomeCanvas with standard gtk widgets
Most are converted to GtkLayout/GtkiDrawingArea widgets as these
most closely approach the GnomeCanvas concept.

This currently builds and runs but has the following issues still:
- item edit isn't drawn properly (margin and offset issues)
- cursor is not handled properly yet

These will be handled in subsequent commits.
2017-03-31 14:03:49 +02:00
Geert Janssens
194634615f Convert gnc-header from GnomeCanvas to GtkLayout
Only reducing column size to less than window width needs extra
research. The auto-expansion of the description column is not
propagated to the header so header and body widths can go
temporarily out of sync as of this commit.
2017-03-31 14:03:49 +02:00
Geert Janssens
539ef52837 Whitespace cosmetics
Replace tabs with spaces
Align some related lines
Remove trailing whitespace
2017-03-23 23:16:10 +01:00
Robert Fewell
4f5658fc7a Bug388500 - Add option to remove deleted files from the history list
This patch simplifies the previous patch so it does not care where the
file is opened from. If it is in the history list and does not exist,
the dialog advises of this and asks if it should be removed from the
list other wise the dialog displays file not found.
2017-03-23 18:38:54 +01:00
John Ralls
66e81040cb Fix DST calculation error.
The symptom was that in 2017 the PDT->PST transition was set a week
late. The cause was that the timezone lookup function went the wrong
way, finding the *next* timezone rule instead of the desired one because
timezone rules are stored for the year that they start rather than when
they end. Fix reverses the search to find the correct timezone rule.

Commit includes new tests to detect the problem.
2017-03-17 15:22:34 -07:00
John Ralls
e66dd12aa9 Fix query period in test-account-get-trans-type-splits-interval.
The query runs from 00:00:00 on the start date to 23:59:59 on the end
date, effectively one day more than the number specified.
2017-03-17 15:22:34 -07:00
Geert Janssens
c4c45e9505 Add missing macros 2017-03-17 09:42:05 +01:00
Geert Janssens
790e358d06 Fix a couple of other deprecated symbols (gtk/gdk 2.x still) 2017-03-16 23:11:47 +01:00
Geert Janssens
dcef648044 Handle deprecation of g_settings_list_keys in gio 2.46 2017-03-16 23:10:26 +01:00
Geert Janssens
8acbc41c61 Raise minimum required version of glib-2.0 to 2.40
At the same time require --std=gnu11 instead of --sdt=gnu99.

This allows us to drop some conditionals is several places. I've
chosen 2.4 as that is the version available in travis, which appears to
be the oldest platform care about. Debian stable has 2.46 in backports,
our windows environment has 2.42
2017-03-16 22:51:52 +01:00
Geert Janssens
79df9b5c26 Merge branch 'maint' 2017-03-16 21:39:06 +01:00
Robert Fewell
43e4b7ff70 Bug 779411 - jqplot fixes for piechart and syntax error.
With the piechart in combination with other charts you have to set the
highlighter and cursor show tooltip to false which stops seen errors.

The syntax errors are caused by only removing the duplicated js files
and not the whole path so changed that to remove whole line.
2017-03-16 21:16:46 +01:00
Robert Fewell
a8ebc794ab Bug388500 - Add option to remove deleted files from the history list
If a file is opened from the history list and does not exist the dialog
advises of this and asks if it should be removed from the list. If a
file is opened from the command line and does not exist, the normal
dialog is used
2017-03-16 20:21:12 +01:00