I think the Terraria / Starbound way is the most intuitive... right-click an item stack to grab 1 (normal clicks grab the entire stack), shift-RMB to grab half. If you already hold items of this type, whatever you grab from the stack stacks with what you're holding, so you can just hold down RMB to grab a bunch and then release it when you have enough (e.g. for doing a particular build task), or you can do a single shift-RMB grab to get half when sharing something equally with a co-op friend.
(It should be pretty easy to code this as well since the cases are all fairly straightforward)